Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use mimalloc allocator #8669

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ This file contains attributions for any 3rd-party open source code used in this
| libdbus-sys | Apache-2.0, MIT | https://crates.io/crates/libdbus-sys |
| libloading | ISC | https://crates.io/crates/libloading |
| libm | MIT, Apache-2.0 | https://crates.io/crates/libm |
| libmimalloc-sys | MIT | https://crates.io/crates/libmimalloc-sys |
| libsqlite3-sys | MIT | https://crates.io/crates/libsqlite3-sys |
| linked-hash-map | MIT, Apache-2.0 | https://crates.io/crates/linked-hash-map |
| linux-raw-sys | Apache-2.0 WITH LLVM-exception, Apache-2.0, MIT | https://crates.io/crates/linux-raw-sys |
Expand All @@ -327,6 +328,7 @@ This file contains attributions for any 3rd-party open source code used in this
| memoffset | MIT | https://crates.io/crates/memoffset |
| miette | Apache-2.0 | https://crates.io/crates/miette |
| miette-derive | Apache-2.0 | https://crates.io/crates/miette-derive |
| mimalloc | MIT | https://crates.io/crates/mimalloc |
| mime | MIT, Apache-2.0 | https://crates.io/crates/mime |
| minicbor | BlueOak-1.0.0 | https://crates.io/crates/minicbor |
| minicbor-derive | BlueOak-1.0.0 | https://crates.io/crates/minicbor-derive |
Expand Down
1 change: 1 addition & 0 deletions implementations/rust/ockam/ockam_command/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ hex = "0.4"
indicatif = "0.17.8"
indoc = "2.0.5"
miette = { version = "7.2.0", features = ["fancy-no-backtrace"] }
mimalloc = { version = "0.1", features = ["secure"] }
minicbor = { version = "0.25.1", default-features = false, features = ["alloc", "derive"] }
nix = { version = "0.29", features = ["signal"] }
ockam = { path = "../ockam", version = "^0.141.0", features = ["software_vault"] }
Expand Down
4 changes: 4 additions & 0 deletions implementations/rust/ockam/ockam_command/src/bin/ockam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
// binary names. The issue is that we need to avoid the `ockam` binary colliding
// with the `ockam` crate.

use mimalloc::MiMalloc;
use ockam_command::util::exitcode;

#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;

fn main() {
if let Err(e) = ockam_command::entry_point::run() {
// initialization errors are displayed here
Expand Down
1 change: 1 addition & 0 deletions tools/stress-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ rust-crypto = ["ockam/rust-crypto"]

[dependencies]
clap = { version = "4.5", features = ["derive", "cargo"] }
mimalloc = { version = "0.1", features = ["secure"] }
ockam = { path = "../../implementations/rust/ockam/ockam" }
ockam_api = { path = "../../implementations/rust/ockam/ockam_api" }
ockam_core = { path = "../../implementations/rust/ockam/ockam_core" }
Expand Down
5 changes: 5 additions & 0 deletions tools/stress-test/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ mod execution;
mod portal_simulator;
mod stats;

use mimalloc::MiMalloc;

#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;

#[derive(Debug, Args, Clone)]
struct RunCommand {
config: PathBuf,
Expand Down
Loading