Skip to content

Commit

Permalink
Merge pull request #10145 from Mause/bugfix/jemalloc-on-windows
Browse files Browse the repository at this point in the history
fix(py): don't use jemalloc on windows
  • Loading branch information
Mytherin authored Jan 5, 2024
2 parents c51346c + 0fda90a commit 0715ef8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/pythonpkg/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ class build_ext(CompilerLauncherMixin, _build_ext):
if platform.system() == 'Windows':
extensions = ['parquet', 'icu', 'fts', 'tpch', 'json']

if platform.system() == 'Linux' and platform.architecture()[0] == '64bit' and not hasattr(sys, 'getandroidapilevel'):
is_android = hasattr(sys, 'getandroidapilevel')
use_jemalloc = not is_android and platform.system() == 'Linux' and platform.architecture()[0] == '64bit'

if use_jemalloc:
extensions.append('jemalloc')

unity_build = 0
Expand Down Expand Up @@ -245,12 +248,12 @@ def list_source_files(directory):
# read the include files, source list and include files from the supplied lists
with open_utf8('sources.list', 'r') as f:
duckdb_sources = [x for x in f.read().split('\n') if len(x) > 0]
if hasattr(sys, 'getandroidapilevel'):
if not use_jemalloc:
duckdb_sources = [x for x in duckdb_sources if 'jemalloc' not in x]

with open_utf8('includes.list', 'r') as f:
duckdb_includes = [x for x in f.read().split('\n') if len(x) > 0]
if hasattr(sys, 'getandroidapilevel'):
if not use_jemalloc:
duckdb_includes = [x for x in duckdb_includes if 'jemalloc' not in x]

source_files += duckdb_sources
Expand Down

0 comments on commit 0715ef8

Please sign in to comment.