Skip to content

Instantly share code, notes, and snippets.

View gist:329ebf2371e3207f330b6a2916384c0f
### Keybase proof
I hereby claim:
* I am flgr on github.
* I am flgr (https://keybase.io/flgr) on keybase.
* I have a public key whose fingerprint is 8404 06A0 CBE6 8BEA B88D A3CD D95D EE3C 8B7E FB1B
To claim this, I am signing this object:
@flgr
flgr / socketpair.c
Created Jul 2, 2013
Program which creates a half-open socketpair, then sits around endlessly, doing nothing
View socketpair.c
#include <sys/socket.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char** argv) {
int sp[2];
if (socketpair(PF_UNIX, SOCK_STREAM, 0, sp) < 0) {
perror("Failed to get socketpair");
}
@flgr
flgr / memcpy-speed.c
Last active Dec 18, 2015
Simplistic way of measuring memcpy() performance on Unix systems.
View memcpy-speed.c
#include <sys/time.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
int main() {
struct timeval t0, t1;
unsigned int i;
unsigned int mb_size = 64;
unsigned int rep = 200;
View ia32_common_transform.patch
--- libfirm/ir/be/ia32/ia32_common_transform.c 2009-12-22 18:14:45.000000000 +0100
+++ libfirm.new/ir/be/ia32/ia32_common_transform.c 2010-03-01 19:28:58.000000000 +0100
@@ -1062,16 +1062,6 @@
if (cnst != NULL) {
offset = get_Const_tarval(cnst);
- if (tarval_is_long(offset)) {
- val = get_tarval_long(offset);
- } else {
- ir_fprintf(stderr, "Optimisation Warning: tarval from %+F is not a "