[compiler-rt] r213929 - [lsan] Follow-up for r213518: replace MAP_ANONYMOUS with MAP_ANON
Alexander Potapenko
glider at google.com
Fri Jul 25 01:57:51 PDT 2014
Author: glider
Date: Fri Jul 25 03:57:51 2014
New Revision: 213929
URL: http://llvm.org/viewvc/llvm-project?rev=213929&view=rev
Log:
[lsan] Follow-up for r213518: replace MAP_ANONYMOUS with MAP_ANON
(despite it's deprecated on Linux) to remove the ifdefs.
Modified:
compiler-rt/trunk/test/lsan/TestCases/register_root_region.cc
Modified: compiler-rt/trunk/test/lsan/TestCases/register_root_region.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lsan/TestCases/register_root_region.cc?rev=213929&r1=213928&r2=213929&view=diff
==============================================================================
--- compiler-rt/trunk/test/lsan/TestCases/register_root_region.cc (original)
+++ compiler-rt/trunk/test/lsan/TestCases/register_root_region.cc Fri Jul 25 03:57:51 2014
@@ -13,15 +13,10 @@
#include <sanitizer/lsan_interface.h>
-// OSX doesn't have MAP_ANONYMOUS.
-#ifndef MAP_ANONYMOUS
-# define MAP_ANONYMOUS MAP_ANON
-#endif
-
int main(int argc, char *argv[]) {
size_t size = getpagesize() * 2;
void *p =
- mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
assert(p);
// Make half of the memory inaccessible. LSan must not crash trying to read it.
assert(0 == mprotect((char *)p + size / 2, size / 2, PROT_NONE));
More information about the llvm-commits
mailing list