@@ -2,15 +2,52 @@ use std::num::NonZeroI32;
22use std:: sync:: { Arc , Mutex } ;
33
44use crossbeam:: queue:: ArrayQueue ;
5- use mimalloc:: MiMalloc ;
65use minimap2:: * ;
76
87use polars:: { df, prelude:: * } ;
98use pyo3:: prelude:: * ;
109use pyo3_polars:: { error:: PyPolarsErr , PyDataFrame } ;
1110
11+ #[ cfg( all(
12+ target_family = "unix" ,
13+ not( target_os = "emscripten" ) ,
14+ not( allocator = "default" ) ,
15+ not( allocator = "mimalloc" ) ,
16+ ) ) ]
17+ use jemallocator:: Jemalloc ;
18+ #[ cfg( all(
19+ not( debug_assertions) ,
20+ not( allocator = "default" ) ,
21+ any(
22+ not( target_family = "unix" ) ,
23+ target_os = "emscripten" ,
24+ allocator = "mimalloc"
25+ ) ,
26+ ) ) ]
27+ use mimalloc:: MiMalloc ;
28+
1229#[ global_allocator]
13- static GLOBAL : MiMalloc = MiMalloc ;
30+ #[ cfg( all(
31+ not( debug_assertions) ,
32+ not( allocator = "mimalloc" ) ,
33+ not( allocator = "default" ) ,
34+ target_family = "unix" ,
35+ not( target_os = "emscripten" ) ,
36+ ) ) ]
37+ static ALLOC : Jemalloc = Jemalloc ;
38+
39+ #[ global_allocator]
40+ #[ cfg( all(
41+ not( debug_assertions) ,
42+ not( allocator = "default" ) ,
43+ any(
44+ not( target_family = "unix" ) ,
45+ target_os = "emscripten" ,
46+ allocator = "mimalloc"
47+ ) ,
48+ ) ) ]
49+ static ALLOC : MiMalloc = MiMalloc ;
50+
1451
1552mod multithreading;
1653
0 commit comments