X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/fe8ab488e9161c46dd9885d58fc52996dc0249ff..c3c9b80d004dbbfdf763edeb97968c6997e3b45b:/tools/tests/perf_index/test_fault_helper.c diff --git a/tools/tests/perf_index/test_fault_helper.c b/tools/tests/perf_index/test_fault_helper.c index 94127979c..e3f8ee3ef 100644 --- a/tools/tests/perf_index/test_fault_helper.c +++ b/tools/tests/perf_index/test_fault_helper.c @@ -6,81 +6,88 @@ #include #include +#if (TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR) +#define MEMSIZE (1L<<28) +#else #define MEMSIZE (1L<<30) +#endif static char* memblock; -int test_fault_setup() { - char *ptr; - int pgsz = getpagesize(); - int retval; +int +test_fault_setup() +{ + char *ptr; + int pgsz = getpagesize(); + int retval; - memblock = (char *)mmap(NULL, MEMSIZE, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); - VERIFY(memblock != MAP_FAILED, "mmap failed"); + memblock = (char *)mmap(NULL, MEMSIZE, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); + VERIFY(memblock != MAP_FAILED, "mmap failed"); - /* make sure memory is paged */ - for(ptr = memblock; ptr