Lines Matching refs:map

27   void* map = mmap(nullptr, 4096, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);  in TEST()  local
28 ASSERT_NE(MAP_FAILED, map); in TEST()
29 ASSERT_EQ(0, munmap(map, 4096)); in TEST()
33 void* map = mmap64(nullptr, 4096, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); in TEST() local
34 ASSERT_NE(MAP_FAILED, map); in TEST()
35 ASSERT_EQ(0, munmap(map, 4096)); in TEST()
41 void* map = mmap(nullptr, 100, PROT_READ, MAP_SHARED, tf.fd, 1); in TEST() local
42 ASSERT_EQ(MAP_FAILED, map); in TEST()
48 void* map = mmap64(nullptr, 100, PROT_READ, MAP_SHARED, tf.fd, 1); in TEST() local
49 ASSERT_EQ(MAP_FAILED, map); in TEST()
62 void* map = mmap(nullptr, sizeof(STRING_MSG), PROT_READ, MAP_SHARED, tf.fd, 0); in TEST() local
63 ASSERT_NE(MAP_FAILED, map); in TEST()
65 char* data = reinterpret_cast<char*>(map); in TEST()
68 ASSERT_EQ(0, munmap(map, sizeof(STRING_MSG))); in TEST()
77 void* map = mmap(nullptr, sizeof(STRING_MSG), PROT_WRITE, MAP_SHARED, tf.fd, 0); in TEST() local
78 ASSERT_NE(MAP_FAILED, map); in TEST()
81 memcpy(map, STRING_MSG, sizeof(STRING_MSG)); in TEST()
83 ASSERT_EQ(0, munmap(map, sizeof(STRING_MSG))); in TEST()
113 void* map = mmap(nullptr, pagesize, PROT_READ, MAP_SHARED, tf.fd, pagesize); in TEST() local
114 ASSERT_NE(MAP_FAILED, map); in TEST()
116 char* data = reinterpret_cast<char*>(map); in TEST()
119 ASSERT_EQ(0, munmap(map, pagesize)); in TEST()
121 map = mmap(nullptr, pagesize, PROT_READ, MAP_SHARED, tf.fd, 2 * pagesize); in TEST()
122 ASSERT_NE(MAP_FAILED, map); in TEST()
124 data = reinterpret_cast<char*>(map); in TEST()
128 ASSERT_EQ(0, munmap(map, pagesize)); in TEST()
149 void* map = mmap(nullptr, pagesize, PROT_WRITE, MAP_SHARED, tf.fd, pagesize); in TEST() local
150 ASSERT_NE(MAP_FAILED, map); in TEST()
153 memcpy(map, NEWPAGE1_MSG, sizeof(NEWPAGE1_MSG)); in TEST()
154 ASSERT_EQ(0, munmap(map, pagesize)); in TEST()
157 map = mmap(nullptr, pagesize, PROT_WRITE, MAP_SHARED, tf.fd, 2 * pagesize); in TEST()
158 ASSERT_NE(MAP_FAILED, map); in TEST()
161 memcpy(map, NEWPAGE2_MSG, sizeof(NEWPAGE2_MSG)); in TEST()
162 ASSERT_EQ(0, munmap(map, pagesize)); in TEST()
184 void* map = mmap(nullptr, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, tempfile.fd, 0); in TEST() local
185 ASSERT_NE(MAP_FAILED, map); in TEST()
188 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_NORMAL)); in TEST()
189 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_SEQUENTIAL)); in TEST()
190 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_RANDOM)); in TEST()
191 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_WILLNEED)); in TEST()
193 ASSERT_EQ(0, munmap(map, pagesize)); in TEST()
202 void* map = mmap(nullptr, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in TEST() local
203 ASSERT_NE(MAP_FAILED, map); in TEST()
205 int* int_ptr = reinterpret_cast<int*>(map); in TEST()
210 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_DONTNEED)); in TEST()
212 int_ptr = reinterpret_cast<int*>(map); in TEST()
217 ASSERT_EQ(0, munmap(map, pagesize)); in TEST()
231 void* map = mmap(nullptr, PAGE_SIZE, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in TEST() local
232 ASSERT_NE(MAP_FAILED, map); in TEST()
234 ASSERT_EQ(MAP_FAILED, mremap(map, PAGE_SIZE, kHuge, MREMAP_MAYMOVE)); in TEST()
236 ASSERT_EQ(0, munmap(map, PAGE_SIZE)); in TEST()
247 void* map = mmap(nullptr, PAGE_SIZE, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in TEST() local
248 ASSERT_NE(MAP_FAILED, map); in TEST()
251 mlock(map, PAGE_SIZE); in TEST()
253 ASSERT_EQ(0, munmap(map, PAGE_SIZE)); in TEST()
260 void* map = mmap(nullptr, PAGE_SIZE, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in TEST()
261 ASSERT_NE(MAP_FAILED, map); in TEST()
264 mlock2(map, PAGE_SIZE, MLOCK_ONFAULT); in TEST()
266 ASSERT_EQ(0, munmap(map, PAGE_SIZE)); in TEST()