/* twofault.c - read-only first touch, then first write, per kind of memory. usage: twofault MB */ #include #include #include #include static double now(void){struct timeval tv;gettimeofday(&tv,0);return tv.tv_sec+tv.tv_usec/1e6;} static volatile int sink; static void rw(const char *what, char *p, long n){ long i; double t0, tr, tw; t0=now(); for(i=0;i