#include "gettime.inc" int main(__attribute__((unused)) int argc, char *argv[]) { unsigned long x, last; map(argc, argv); fprintf(stderr, "filling array...\n"); last = 0; for (x = 0; x < LEN_P - 0x10000; x++) { unsigned long pos; do { pos = random() % LEN_P; } while (m_p[pos] || pos == last); m_p[last] = &m_p[pos]; last = pos; /*if (!(x & 65535)) fprintf(stderr, "%lx\n", x);*/ } m_p[last] = &m_p[0]; fprintf(stderr, "benchmarking...\n"); start_loop { void *p = &m_p[0]; for (i = 0; i < LEN_L; i++) { p = *(void **)p; } __asm__ volatile ("" :: "r"(p)); } end_loop(LEN_L, LEN); return 0; }