Skip to content

Commit c1be81a

Browse files
committed
enable jemalloc but only on linux 64bit, aligned with duckdb core
1 parent 41ae2b5 commit c1be81a

2 files changed

Lines changed: 18 additions & 25 deletions

File tree

cmake/duckdb_loader.cmake

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -114,25 +114,18 @@ function(_duckdb_validate_jemalloc_config)
114114
return()
115115
endif()
116116

117-
# jemalloc is only allowed in linux and osx debug builds
118-
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
119-
set(supported_os TRUE)
120-
else()
121-
set(supported_os FALSE)
122-
endif()
123-
124-
# jemalloc is only allowed in debug builds
125-
if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND supported_os)
117+
# jemalloc is only enabled on 64bit x86 linux builds
118+
if(CMAKE_SIZEOF_VOID_P EQUAL 8
119+
AND OS_NAME STREQUAL "linux"
120+
AND NOT BSD)
126121
set(jemalloc_allowed TRUE)
127122
else()
128123
set(jemalloc_allowed FALSE)
129124
endif()
130125

131126
if(NOT jemalloc_allowed)
132-
message(
133-
WARNING
134-
"jemalloc extension is only supported on Linux and OSX in Debug builds.\n"
135-
"Removing jemalloc from extension list.")
127+
message(WARNING "jemalloc extension is only supported on Linux.\n"
128+
"Removing jemalloc from extension list.")
136129
# Remove jemalloc from the extension list
137130
string(REPLACE "jemalloc" "" BUILD_EXTENSIONS_FILTERED
138131
"${BUILD_EXTENSIONS}")
@@ -187,17 +180,17 @@ function(_duckdb_create_interface_target target_name)
187180
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
188181
target_compile_options(
189182
${target_name}
190-
INTERFACE
191-
/wd4244 # suppress Conversion from 'type1' to 'type2', possible loss of
192-
# data
193-
/wd4267 # suppress Conversion from ‘size_t’ to ‘type’, possible loss of
194-
# data
195-
/wd4200 # suppress Nonstandard extension used: zero-sized array in
196-
# struct/union
197-
/wd26451
198-
/wd26495 # suppress Code Analysis
199-
/D_CRT_SECURE_NO_WARNINGS # suppress warnings about unsafe functions
200-
/utf-8 # treat source files as UTF-8 encoded
183+
INTERFACE /wd4244 # suppress Conversion from 'type1' to 'type2', possible
184+
# loss of data
185+
/wd4267 # suppress Conversion from ‘size_t’ to ‘type’, possible
186+
# loss of data
187+
/wd4200 # suppress Nonstandard extension used: zero-sized array
188+
# in struct/union
189+
/wd26451
190+
/wd26495 # suppress Code Analysis
191+
/D_CRT_SECURE_NO_WARNINGS # suppress warnings about unsafe
192+
# functions
193+
/utf-8 # treat source files as UTF-8 encoded
201194
)
202195
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
203196
target_compile_options(

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ packages.adbc_driver_duckdb = "adbc_driver_duckdb"
8282
packages._duckdb-stubs = "_duckdb-stubs"
8383

8484
[tool.scikit-build.cmake.define]
85-
BUILD_EXTENSIONS = "core_functions;json;parquet;icu"
85+
BUILD_EXTENSIONS = "core_functions;json;parquet;icu;jemalloc"
8686

8787
[tool.setuptools_scm]
8888
version_scheme = "duckdb_packaging.setuptools_scm_version:version_scheme"

0 commit comments

Comments
 (0)