Skip to content

Commit

Permalink
Python: only use jemalloc on linux (#3126)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Apr 12, 2022
1 parent d0656a4 commit 95096a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions py-polars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ description = "Blazingly fast DataFrame library"
[workspace]
# prevents package from thinking it's in the workspace

[target.'cfg(windows)'.dependencies]
[target.'cfg(not(target_os="linux"))'.dependencies]
mimalloc = { version = "*", default-features = false }

[target.'cfg(not(windows))'.dependencies]
[target.'cfg(target_os="linux")'.dependencies]
jemallocator = { version = "0.3", features = ["disable_initial_exec_tls"] }

[dependencies]
Expand Down
8 changes: 4 additions & 4 deletions py-polars/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ use crate::error::{
use crate::file::get_either_file;
use crate::prelude::{ClosedWindow, DataType, DatetimeArgs, Duration, DurationArgs, PyDataType};
use dsl::ToExprs;
#[cfg(not(target_os = "windows"))]
#[cfg(target_os = "linux")]
use jemallocator::Jemalloc;
#[cfg(target_os = "windows")]
#[cfg(not(target_os = "linux"))]
use mimalloc::MiMalloc;
use polars::functions::{diag_concat_df, hor_concat_df};
use polars::prelude::Null;
Expand All @@ -51,11 +51,11 @@ use polars_core::prelude::IntoSeries;
use pyo3::types::{PyBool, PyDict, PyFloat, PyInt, PyString};

#[global_allocator]
#[cfg(not(target_os = "windows"))]
#[cfg(target_os = "linux")]
static ALLOC: Jemalloc = Jemalloc;

#[global_allocator]
#[cfg(target_os = "windows")]
#[cfg(not(target_os = "linux"))]
static ALLOC: MiMalloc = MiMalloc;

#[pyfunction]
Expand Down

0 comments on commit 95096a7

Please sign in to comment.