Skip to content

Commit 09e5b81

Browse files
authored
Merge pull request #139 from igchor/glibc_malloc
Link jemalloc pool and test with libc explicitly to avoid recursive calls to jemalloc (tmp fix)
2 parents 379a785 + 6e34d1c commit 09e5b81

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/pool/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ endif()
3030
# libumf_pool_jemalloc
3131
if(UMF_BUILD_LIBUMF_POOL_JEMALLOC)
3232
if(LINUX)
33+
# TODO: we link directly with libc to force using malloc from glibc
34+
# This is a temporary fix for https://github.com/oneapi-src/unified-memory-framework/issues/161
3335
add_umf_library(NAME jemalloc_pool
3436
TYPE STATIC
3537
SRCS pool_jemalloc.c
36-
LIBS jemalloc umf_utils)
38+
LIBS c jemalloc umf_utils)
3739
add_library(${PROJECT_NAME}::jemalloc_pool ALIAS jemalloc_pool)
3840
install(TARGETS jemalloc_pool
3941
EXPORT ${PROJECT_NAME}-targets

test/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ endif()
7878

7979
if(UMF_BUILD_OS_MEMORY_PROVIDER)
8080
if(UMF_BUILD_LIBUMF_POOL_JEMALLOC)
81+
# TODO: we link directly with libc to force using malloc from glibc
82+
# This is a temporary fix for https://github.com/oneapi-src/unified-memory-framework/issues/161
8183
add_umf_test(NAME jemalloc_pool
8284
SRCS pools/jemalloc_pool.cpp malloc_compliance_tests.cpp
83-
LIBS jemalloc_pool)
85+
LIBS c jemalloc_pool)
8486
endif()
8587
else()
8688
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)