From: Ivan Maidanski Date: Tue, 31 Jul 2018 06:32:27 +0000 (+0300) Subject: Allow mmap enabling in CMake script X-Git-Tag: v8.0.0~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=955d7d7f5772aa8b703f82d14fb5e45cea6bcfdd;p=gc Allow mmap enabling in CMake script * CMakeLists.txt (enable_mmap): New OPTION (off by default). * CMakeLists.txt [!enable_munmap && enable_mmap]: Define USE_MMAP macro. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d6c113c4..baf19377 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)