Skip to content

Commit e0df015

Browse files
committed
Use mimalloc allocator across builds
1 parent e044e50 commit e0df015

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/cli-python/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ harness = false
5555
[dependencies]
5656
sqruff-cli-lib.workspace = true
5757
sqruff-cli-lib.features = ["python"]
58+
mimalloc = "0.1"
5859

5960
[dev-dependencies]
6061
assert_cmd = "2.0.16"

crates/cli-python/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
use pyo3::prelude::*;
22

3+
#[cfg(not(target_family = "wasm"))]
4+
#[global_allocator]
5+
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
6+
37
/// Parse CLI args and execute the tool. Exposed to Python as `run_cli`.
48
#[pyfunction]
59
fn run_cli(args: Vec<String>) -> PyResult<i32> {

crates/cli/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ ignored = ["pyo3"]
7070
[dependencies]
7171
sqruff-cli-lib.workspace = true
7272
pyo3 = { version = "0.25.1", features = ["auto-initialize"], optional = true }
73-
74-
[target.'cfg(target_os = "windows")'.dependencies]
7573
mimalloc = "0.1"
7674

7775
[dev-dependencies]

crates/cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[cfg(target_os = "windows")]
1+
#[cfg(not(target_family = "wasm"))]
22
#[global_allocator]
33
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
44

0 commit comments

Comments
 (0)