/* anoncost.c - first-touch cost per page for different kinds of anonymous memory. usage: anoncost MB */ #include #include #include #include #include #include #include #include #include static double now(void){struct timeval tv;gettimeofday(&tv,0);return tv.tv_sec+tv.tv_usec/1e6;} static void touch(const char *what, char *p, long n, long pg){ long i; double t0=now(); for(i=0;i