From ebc1dab1cf0a26d368540eef81012cc00a21ed77 Mon Sep 17 00:00:00 2001 From: Roy Schuster Date: Fri, 12 Apr 2019 09:51:52 +0100 Subject: [PATCH] Passing the EXPOSE_SHARED_ALLOCATOR argument to cmake will now expose the external allocator and pagemap sharing API --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fafa66..ab8cb38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(snmalloc C CXX) option(USE_SNMALLOC_STATS "Track allocation stats" OFF) option(USE_MEASURE "Measure performance with histograms" OFF) option(USE_SBRK "Use sbrk instead of mmap" OFF) +option(EXPOSE_EXTERNAL_ALLOCATOR_API "Expose the API that allows using external allocators and sharing pagemaps" OFF) set(CACHE_FRIENDLY_OFFSET OFF CACHE STRING "Base offset to place linked-list nodes.") @@ -67,6 +68,10 @@ if(USE_SBRK) add_definitions(-DUSE_SBRK) endif() +if(EXPOSE_EXTERNAL_ALLOCATOR_API) + add_definitions(-DSNMALLOC_EXPOSE_RESERVE -DSNMALLOC_EXPOSE_PAGEMAP) +endif() + macro(add_shim name) add_library(${name} SHARED src/override/malloc.cc) target_link_libraries(${name} -pthread)