Skip to content

Commit a3e1a9e

Browse files
committed
Link jemalloc pool and test with libc
This forces the linker to link with libc before linking with jemalloc. Because of that, jemalloc will not override symbols for malloc/free.
1 parent 74fe7d0 commit a3e1a9e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/pool/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if(UMF_BUILD_LIBUMF_POOL_JEMALLOC)
3333
add_umf_library(NAME jemalloc_pool
3434
TYPE STATIC
3535
SRCS pool_jemalloc.c
36-
LIBS jemalloc umf_utils)
36+
LIBS c jemalloc umf_utils) # TODO: link directly with libc to force using malloc from glibc
3737
add_library(${PROJECT_NAME}::jemalloc_pool ALIAS jemalloc_pool)
3838
install(TARGETS jemalloc_pool
3939
EXPORT ${PROJECT_NAME}-targets

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ if(UMF_BUILD_OS_MEMORY_PROVIDER)
8282
if(UMF_BUILD_LIBUMF_POOL_JEMALLOC)
8383
add_umf_test(NAME jemalloc_pool
8484
SRCS pools/jemalloc_pool.cpp malloc_compliance_tests.cpp
85-
LIBS jemalloc_pool)
85+
LIBS c jemalloc_pool) # TODO: link directly with libc to force using malloc from glibc
8686
endif()
8787
else()
8888
message(STATUS "The jemalloc_pool test is DISABLED, because it uses OS_MEMORY_PROVIDER, while the UMF_BUILD_OS_MEMORY_PROVIDER option is set to OFF")

0 commit comments

Comments
 (0)