Skip to content

Commit

Permalink
feat(lib.rs): add mimalloc as the global allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
sansyrox committed Aug 8, 2023
1 parent 416bc97 commit d602186
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ futures-util = "0.3.27"
matchit = "0.7.0"
socket2 = { version = "0.5.1", features = ["all"] }
uuid = { version = "1.3.0", features = ["serde", "v4"] }
mimalloc = { version = "0.1.37", default-features = false, features = ["local_dynamic_tls"] }
log = "0.4.17"
pythonize = "0.19.0"
serde = "1.0.178"
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ use types::{
HttpMethod,
};

#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

#[pyfunction]
fn get_version() -> String {
env!("CARGO_PKG_VERSION").into()
Expand Down

0 comments on commit d602186

Please sign in to comment.