OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #include <setjmp.h> | 7 #include <setjmp.h> |
8 #include <sys/mman.h> | 8 #include <sys/mman.h> |
9 | 9 |
| 10 #include "native_client/src/include/nacl_defines.h" |
| 11 |
10 #if NACL_LINUX | 12 #if NACL_LINUX |
11 # include <sys/syscall.h> | 13 # include <sys/syscall.h> |
12 # include <time.h> | 14 # include <time.h> |
13 #endif | 15 #endif |
14 | 16 |
15 #include "native_client/src/include/nacl_assert.h" | 17 #include "native_client/src/include/nacl_assert.h" |
16 #if defined(__native_client__) | 18 #if defined(__native_client__) |
17 #include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h" | 19 #include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h" |
18 #endif | 20 #endif |
19 #include "native_client/tests/performance/perf_test_compat_osx.h" | 21 #include "native_client/tests/performance/perf_test_compat_osx.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 public: | 104 public: |
103 virtual void run() { | 105 virtual void run() { |
104 size_t size = 0x10000; | 106 size_t size = 0x10000; |
105 void *addr = mmap(NULL, size, PROT_READ | PROT_WRITE, | 107 void *addr = mmap(NULL, size, PROT_READ | PROT_WRITE, |
106 MAP_ANON | MAP_PRIVATE, -1, 0); | 108 MAP_ANON | MAP_PRIVATE, -1, 0); |
107 ASSERT_NE(addr, MAP_FAILED); | 109 ASSERT_NE(addr, MAP_FAILED); |
108 ASSERT_EQ(munmap(addr, size), 0); | 110 ASSERT_EQ(munmap(addr, size), 0); |
109 } | 111 } |
110 }; | 112 }; |
111 PERF_TEST_DECLARE(TestMmapAnonymous) | 113 PERF_TEST_DECLARE(TestMmapAnonymous) |
OLD | NEW |