]> granicus.if.org Git - gc/commitdiff
Allow mmap enabling in CMake script
authorIvan Maidanski <ivmai@mail.ru>
Tue, 31 Jul 2018 06:32:27 +0000 (09:32 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 31 Jul 2018 06:47:59 +0000 (09:47 +0300)
* CMakeLists.txt (enable_mmap): New OPTION (off by default).
* CMakeLists.txt [!enable_munmap && enable_mmap]: Define USE_MMAP macro.

CMakeLists.txt

index d6c113c43829e91560b5069241619bfa4954fc26..baf1937773426b4b5713ef11149c3cd6829418f4 100644 (file)
@@ -194,10 +194,14 @@ IF(enable_redirect_malloc)
     ADD_DEFINITIONS("-DGC_USE_DLOPEN_WRAP")
 ENDIF(enable_redirect_malloc)
 
+OPTION(enable_mmap "Use mmap instead of sbrk to expand the heap" NO)
+
 OPTION(enable_munmap "Return page to the OS if empty for N collections" ON)
 IF(enable_munmap)
     ADD_DEFINITIONS("-DUSE_MMAP -DUSE_MUNMAP")
-ENDIF(enable_munmap)
+ELSEIF(enable_mmap)
+    ADD_DEFINITIONS("-DUSE_MMAP")
+ENDIF()
 
 OPTION(enable_large_config "Optimize for large heap or root set" NO)
 IF(enable_large_config)