64 unsigned char **p, **p2;
75 for(i=0; i<half; ++i) {
76 *p = (
unsigned char *) p2;
77 *p2 = (
unsigned char *) (p + stride8);
82 *(p2 - stride8) = (
unsigned char *)0;
92 for(i=0; i<iterations; ++i) {
95 while(p = (
unsigned char **) *p);
105 long pagesize = sysconf(_SC_PAGE_SIZE);
106 long kb_per_page = pagesize /
KILOBYTE;
107 long bytes = kb_to_alloc *
KILOBYTE;
108 char *memhunk = (
char *)
malloc(bytes);
110 printf(
"Striding through %ld KB with %ld iterations\n",
111 kb_to_alloc, iterations);
114 for(; --iterations; ) {
133 printf(
"Usage: %s size(KB) iter\n", argv[0]);
137 kilobytes = atol(argv[1]);
138 iterations = atol(argv[2]);
void MONITOR_EXT_WRAP_NAME() free(void *ptr)
int main(int argc, char **argv)
unsigned char * chase_array
void initialize_pointer_chase(long bytes)
void *MONITOR_EXT_WRAP_NAME() malloc(size_t bytes)
void pointer_chase(long iterations, long kilobytes)
void memory_stride(long iterations, long kb_to_alloc)