[PATCH] D47146: Memorysanitizer fix mmap test for oses not supporting MAP_NORESERVE flag
David CARLIER via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 21 10:47:25 PDT 2018
devnexen updated this revision to Diff 147816.
devnexen retitled this revision from "Memorysanitizer fix mmap test for non Linux oses" to "Memorysanitizer fix mmap test for oses not supporting MAP_NORESERVE flag".
devnexen edited the summary of this revision.
Herald added a subscriber: emaste.
https://reviews.llvm.org/D47146
Files:
test/msan/mmap.cc
Index: test/msan/mmap.cc
===================================================================
--- test/msan/mmap.cc
+++ test/msan/mmap.cc
@@ -63,9 +63,13 @@
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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47146.147816.patch
Type: text/x-patch
Size: 596 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180521/a579a2d0/attachment.bin>
More information about the llvm-commits
mailing list