Skip to content

Commit

Permalink
Replace jemalloc with mimalloc (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
morphy2k authored Jun 12, 2023
1 parent 8dede72 commit 33530e1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
41 changes: 20 additions & 21 deletions Cargo.lock

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

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ exclude = ["/example", "/.github"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = ["mimalloc"]

[dependencies]
tokio = { version = "1.28", features = [
"rt-multi-thread",
Expand Down Expand Up @@ -41,8 +44,8 @@ pico-args = "0.5"
html2text = "0.6"
slack-bk = "0.1"

[target.'cfg(not(target_env = "msvc"))'.dependencies]
jemallocator = "0.5"
# Optional dependencies
mimalloc = { version = "0.1", optional = true }

[profile.release]
lto = true
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ use tokio::{
};
use tracing::{error, info};

#[cfg(not(target_env = "msvc"))]
#[cfg(feature = "mimalloc")]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;

pub type Result<T> = std::result::Result<T, Error>;

Expand Down

0 comments on commit 33530e1

Please sign in to comment.