Skip to content

Commit

Permalink
chore: Allow for choice in memory allocator and use mimalloc for pola…
Browse files Browse the repository at this point in the history
…rs-lts-cpu (#5414)

Co-authored-by: Louis Groux <louis.groux@paige.ai>
  • Loading branch information
CalOmnie and Louis Groux committed Nov 4, 2022
1 parent ffa17c0 commit 3e34e69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-py-release-manylinux-lts-cpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: messense/maturin-action@v1
env:
MATURIN_PASSWORD: ${{ secrets.PYPI_PASS }}
RUSTFLAGS: -C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt
RUSTFLAGS: -C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt --cfg use_mimalloc
with:
rust-toolchain: nightly-2022-10-24
maturin-version: '0.13.5'
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 @@ -25,10 +25,10 @@ mod set;
mod sql;
pub mod utils;

#[cfg(target_os = "linux")]
#[cfg(all(target_os = "linux", not(use_mimalloc)))]
use jemallocator::Jemalloc;
use lazy::ToExprs;
#[cfg(not(target_os = "linux"))]
#[cfg(any(not(target_os = "linux"), use_mimalloc))]
use mimalloc::MiMalloc;
use polars::functions::{diag_concat_df, hor_concat_df};
use polars::prelude::Null;
Expand Down Expand Up @@ -57,11 +57,11 @@ use crate::prelude::{
use crate::series::PySeries;

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

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

#[pyfunction]
Expand Down

0 comments on commit 3e34e69

Please sign in to comment.