]> granicus.if.org Git - gc/commitdiff
Refactoring of USE_MMAP/USE_MMAP_ANON pairs definition in gcconfig.h
authorIvan Maidanski <ivmai@mail.ru>
Fri, 14 Jul 2017 17:02:44 +0000 (20:02 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 14 Jul 2017 17:02:44 +0000 (20:02 +0300)
* 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.

include/private/gcconfig.h

index a7887d83f39101d49274e92ef2b2f6e9bc9e82dc..886ab9c0e0a6c25b58cfee2157eef27d72abacd4 100644 (file)
       /* 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 <unistd.h>
 #       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.
 #   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
 #         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
 #     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
 #     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 <unistd.h>
 #     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 <unistd.h>
 #     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 <unistd.h>
 #     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 <unistd.h>
     /* 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