Skip to content

Instantly share code, notes, and snippets.

View retep998's full-sized avatar
🐇
Very fluffy

Peter Atashian retep998

🐇
Very fluffy
  • Massachusetts, USA
View GitHub Profile
@retep998
retep998 / extra.cpp
Created February 13, 2014 00:49
An example of valid C++ code that results in implementation defined behavior at best, undefined at worst.
#include <iostream>
struct foo {
double bar;
};
void func(foo x) {
std::cout << x.bar;
}

Keybase proof

I hereby claim:

  • I am retep998 on github.
  • I am retep998 (https://keybase.io/retep998) on keybase.
  • I have a public key whose fingerprint is 4E05 754D 8D16 BA24 C248 FBFF A827 6CCD 72F3 0C82

To claim this, I am signing this object:

; ModuleID = 'test.rc'
target datalayout = "e-p:32:32-f64:64:64-i64:64:64-f80:32:32-n8:16:32"
target triple = "i686-pc-mingw32"
%tydesc = type { i32, i32, void ({}*, i8*)*, void ({}*, i8*)*, void ({}*, i8*)*, void ({}*, i8*)*, i32, { i8*, i32 } }
%str_slice = type { i8*, i32 }
@_rust_crate_map_toplevel = dllexport global { i32, { i32, i32 }, { i32, i32 }, i32* } { i32 2, { i32, i32 } { i32 ptrtoint ([0 x { { i8*, i32 }, i32 }]* @_rust_mod_map to i32), i32 0 }, { i32, i32 } { i32 ptrtoint ([3 x i32]* @_crate_map_child_vectors to i32), i32 3 }, i32* @_ZN4uvio8new_loop19h11261c8c125a261daK4v0.9E }
@str1252 = internal constant [13 x i8] c"Hello World!\00"
@_ZN19_rust_crate_map_std17_3e5aeb837ae1622e4v0.9E = external global i32
@retep998
retep998 / msvc32.asm
Last active August 29, 2015 14:02
Rust vs C++
nl::bench::recurse_sub:
009312E0 push ebp
009312E1 mov ebp,esp
009312E3 and esp,0FFFFFFF8h
009312E6 sub esp,14h
009312E9 mov eax,dword ptr [ebp+8]
009312EC push ebx
009312ED push esi
009312EE push edi
009312EF mov ebx,dword ptr [eax]
#![feature(phase, macro_rules)]
#[phase(plugin)]
extern crate green;
use std::collections::{HashMap, SmallIntMap};
use std::comm::{Receiver, Sender};
use std::io::{Acceptor, BufferedReader, BufferedWriter, BufReader, IoResult, Listener, MemWriter, TcpListener, TcpStream, stdin};
use std::sync::{Arc, RWLock};
@retep998
retep998 / 6-20.s
Created June 26, 2014 20:17
comparison of asm for code generated by rustc
.text
.def @feat.00;
.scl 3;
.type 0;
.endef
.globl @feat.00
@feat.00 = 1
.def __ZN2p320heb5d6e0aa9a57a67iaa4v0.0E;
.scl 3;
.type 32;
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 6960.0x1ed0]
0x004ccc9c in stream::read_cb::h0aa53bd142f22e38jZf::v0.11.0.pre ()
(gdb) Exception condition detected on fd 0
error detected on stdin
A debugging session is active.
Inferior 1 [process 6960] will be killed.
Quit anyway? (y or n) n
@retep998
retep998 / gist:224bfb130448e086df76
Created June 29, 2014 00:42
This causes a segfault
#![feature(phase)]
#[phase(plugin)]
extern crate green;
use std::io::{Acceptor, Listener, TcpListener, TcpStream};
use std::io::timer::sleep;
green_start!(main)
fn main() {
@retep998
retep998 / c++.asm
Last active August 29, 2015 14:03
assembly comparison
--- a:\files\coding\nolifestory\src\nxbench\nxbench.cpp ------------------------
nl::bench::recurse_sub:
00AD12E0 push ebp
00AD12E1 mov ebp,esp
00AD12E3 and esp,0FFFFFFF8h
00AD12E6 sub esp,14h
00AD12E9 mov eax,dword ptr [ebp+8]
00AD12EC push ebx
00AD12ED push esi
00AD12EE push edi
@retep998
retep998 / libuv.diff
Created July 3, 2014 18:08
libuv changes
diff --git a/.mailmap b/.mailmap
index 7d627a3..89c1ade 100644
--- a/.mailmap
+++ b/.mailmap
@@ -10,10 +10,12 @@ Fedor Indutny <fedor.indutny@gmail.com> <fedor@indutny.com>
Frank Denis <github@pureftpd.org>
Isaac Z. Schlueter <i@izs.me>
Justin Venus <justin.venus@gmail.com> <justin.venus@orbitz.com>
-Keno Fischer <kenof@stanford.edu> <kfischer@college.harvard.edu>
Keno Fischer <kenof@stanford.edu> <kfischer+github@college.harvard.edu>