[compiler-rt] r333306 - [MemorySanitizer] fix mmap test for oses not implementing MAP_NORESERVE flag
David Carlier via llvm-commits
llvm-commits at lists.llvm.org
Fri May 25 13:30:39 PDT 2018
Author: devnexen
Date: Fri May 25 13:30:39 2018
New Revision: 333306
URL: http://llvm.org/viewvc/llvm-project?rev=333306&view=rev
Log:
[MemorySanitizer] fix mmap test for oses not implementing MAP_NORESERVE flag
Reviewers: krytarowski, eugenis
Reviewed By: eugenis
Differential Revision: https://review.llvm.org/D47146
Modified:
compiler-rt/trunk/test/msan/mmap.cc
Modified: compiler-rt/trunk/test/msan/mmap.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/mmap.cc?rev=333306&r1=333305&r2=333306&view=diff
==============================================================================
--- compiler-rt/trunk/test/msan/mmap.cc (original)
+++ compiler-rt/trunk/test/msan/mmap.cc Fri May 25 13:30:39 2018
@@ -63,9 +63,13 @@ int main() {
const size_t kMapSize = 0x1000000000ULL;
#endif
int success_count = 0;
+ int flags = MAP_PRIVATE | MAP_ANONYMOUS;
+#if defined(MAP_NORESERVE)
+ flags |= MAP_NORESERVE;
+#endif
while (true) {
void *p = mmap(0, kMapSize, PROT_WRITE,
- MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0);
+ flags, -1, 0);
printf("%p\n", p);
if (p == MAP_FAILED) {
assert(errno == ENOMEM);
More information about the llvm-commits
mailing list