Skip to content

Commit

Permalink
disable jemalloc through cmake, not through ci script
Browse files Browse the repository at this point in the history
  • Loading branch information
lnkuiper committed Aug 15, 2024
1 parent 709a18d commit 7c1e787
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/NightlyTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:
shell: bash
run: |
mkdir -p build/release
(cd build/release && cmake -G "Ninja" -DSTATIC_LIBCPP=1 -DBUILD_EXTENSIONS='icu;parquet;fts;json' -DFORCE_32_BIT=1 -DSKIP_EXTENSIONS="jemalloc" -DCMAKE_BUILD_TYPE=Release ../.. && cmake --build .)
(cd build/release && cmake -G "Ninja" -DSTATIC_LIBCPP=1 -DBUILD_EXTENSIONS='icu;parquet;fts;json' -DFORCE_32_BIT=1 -DCMAKE_BUILD_TYPE=Release ../.. && cmake --build .)
- name: Test
shell: bash
Expand Down
4 changes: 3 additions & 1 deletion extension/extension_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
duckdb_extension_load(parquet)

# The Linux allocator has issues so we use jemalloc, but only on x86 because page sizes are fixed at 4KB.
# Configuring jemalloc properly for 32bit is a hassle, and not worth it so we only enable on 64bit
# If page sizes vary for an architecture (e.g., arm64), we cannot create a portable binary due to jemalloc config
if(OS_NAME STREQUAL "linux" AND (OS_ARCH STREQUAL "amd64" OR OS_ARCH STREQUAL "i386") AND NOT WASM_LOADABLE_EXTENSIONS AND NOT CLANG_TIDY AND NOT ANDROID AND NOT ZOS)
# FIXME: after configuring the jemalloc config, jemalloc should work on arm64 again (should try at some point)
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT FORCE_32_BIT AND OS_NAME STREQUAL "linux" AND (OS_ARCH STREQUAL "amd64" OR OS_ARCH STREQUAL "i386") AND NOT WASM_LOADABLE_EXTENSIONS AND NOT CLANG_TIDY AND NOT ANDROID AND NOT ZOS)
duckdb_extension_load(jemalloc)
endif()
3 changes: 2 additions & 1 deletion src/common/allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#endif

#ifndef USE_JEMALLOC
#if defined(DUCKDB_EXTENSION_JEMALLOC_LINKED) && DUCKDB_EXTENSION_JEMALLOC_LINKED && !defined(WIN32)
#if defined(DUCKDB_EXTENSION_JEMALLOC_LINKED) && DUCKDB_EXTENSION_JEMALLOC_LINKED && !defined(WIN32) && \
INTPTR_MAX == INT64_MAX
#define USE_JEMALLOC
#endif
#endif
Expand Down

0 comments on commit 7c1e787

Please sign in to comment.