From: Ivan Maidanski Date: Fri, 14 Jul 2017 17:02:44 +0000 (+0300) Subject: Refactoring of USE_MMAP/USE_MMAP_ANON pairs definition in gcconfig.h X-Git-Tag: v8.0.0~639 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6efe15d352a5b3d5dc00a356e7ad82288736eb28;p=gc Refactoring of USE_MMAP/USE_MMAP_ANON pairs definition in gcconfig.h * include/private/gcconfig.h [POWERPC && (DARWIN || AIX) || NACL || I386 && (HURD || DARWIN) || (AARCH64 || ARM32 || X86_64) && DARWIN] (USE_MMAP): Do not define explicitly (as USE_MMAP_ANON is defined explicitly). * include/private/gcconfig.h [NACL] (USE_MMAP_FIXED): Do not undefine explicitly (as it is not defined by default). * include/private/gcconfig.h [I386 && NACL] (HEAP_START): Do not define value for the case of no USE_MMAP (as the latter is always defined). * include/private/gcconfig.h [USE_MMAP_ANON && !USE_MMAP] (USE_MMAP): Define. --- diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index a7887d83..886ab9c0 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -972,9 +972,6 @@ /* These aren't used when dyld support is enabled (it is by default). */ # define DATASTART ((ptr_t)get_etext()) # define DATAEND ((ptr_t)get_end()) -# ifndef USE_MMAP -# define USE_MMAP -# endif # define USE_MMAP_ANON # define MPROTECT_VDB # include @@ -1064,9 +1061,6 @@ # define CPP_WORDSZ 32 # define STACKBOTTOM ((ptr_t)((ulong)&errno)) # endif -# ifndef USE_MMAP -# define USE_MMAP -# endif # define USE_MMAP_ANON /* From AIX linker man page: _text Specifies the first location of the program. @@ -1107,10 +1101,8 @@ # undef STACK_GRAN # define STACK_GRAN 0x10000 # define HEURISTIC1 -# define USE_MMAP # define USE_MUNMAP # define USE_MMAP_ANON -# undef USE_MMAP_FIXED # define GETPAGESIZE() 65536 # define MAX_NACL_GC_THREADS 1024 # endif @@ -1358,11 +1350,7 @@ # define USE_MMAP # endif # define MAP_FAILED (void *) ((word)-1) -# ifdef USE_MMAP -# define HEAP_START (ptr_t)0x40000000 -# else -# define HEAP_START DATAEND -# endif +# define HEAP_START (ptr_t)0x40000000 # endif /* DGUX */ # ifdef NACL @@ -1595,9 +1583,6 @@ # define DATAEND ((ptr_t)(_end)) /* # define MPROTECT_VDB Not quite working yet? */ # define DYNAMIC_LOADING -# ifndef USE_MMAP -# define USE_MMAP -# endif # define USE_MMAP_ANON # endif # ifdef DARWIN @@ -1611,9 +1596,6 @@ # define DATASTART ((ptr_t)get_etext()) # define DATAEND ((ptr_t)get_end()) # define STACKBOTTOM ((ptr_t)0xc0000000) -# ifndef USE_MMAP -# define USE_MMAP -# endif # define USE_MMAP_ANON # define MPROTECT_VDB # include @@ -2170,9 +2152,6 @@ # define DATASTART ((ptr_t)get_etext()) # define DATAEND ((ptr_t)get_end()) # define STACKBOTTOM ((ptr_t)0x16fdfffff) -# ifndef USE_MMAP -# define USE_MMAP -# endif # define USE_MMAP_ANON # define MPROTECT_VDB # include @@ -2286,9 +2265,6 @@ # define DATASTART ((ptr_t)get_etext()) # define DATAEND ((ptr_t)get_end()) # define STACKBOTTOM ((ptr_t)0x30000000) -# ifndef USE_MMAP -# define USE_MMAP -# endif # define USE_MMAP_ANON # define MPROTECT_VDB # include @@ -2479,9 +2455,6 @@ # define DATASTART ((ptr_t)get_etext()) # define DATAEND ((ptr_t)get_end()) # define STACKBOTTOM ((ptr_t)0x7fff5fc00000) -# ifndef USE_MMAP -# define USE_MMAP -# endif # define USE_MMAP_ANON # define MPROTECT_VDB # include @@ -2662,7 +2635,9 @@ /* We tried ... */ #endif -#if defined(LINUX) && defined(USE_MMAP) +#if defined(USE_MMAP_ANON) && !defined(USE_MMAP) +# define USE_MMAP +#elif defined(LINUX) && defined(USE_MMAP) /* The kernel may do a somewhat better job merging mappings etc. */ /* with anonymous mappings. */ # define USE_MMAP_ANON