Skip to content

Commit

Permalink
feat: New feature to enable Mimalloc allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsvante committed Jan 6, 2023
1 parent 87df98d commit 026cf77
Show file tree
Hide file tree
Showing 4 changed files with 30 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 @@ -29,6 +29,7 @@ indexmap = "1.9.2"
itertools = "0.10.5"
jsonwebtoken = "8.2.0"
log = "0.4.17"
mimalloc = { version = "0.1.32", default-features = false, optional = true }
mime = "0.3.16"
mime_guess = "2.0.4"
num_enum = "0.5.7"
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ COPY Cargo.toml Cargo.lock ./

RUN cargo build \
--features ui \
--features mimalloc \
--release


Expand Down
8 changes: 8 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#![forbid(unsafe_code)]

#[cfg(feature = "mimalloc")]
use mimalloc::MiMalloc;

#[cfg(feature = "mimalloc")]
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;

#[cfg(feature = "cli")]
use std::process::{ExitCode, Termination};

Expand Down

0 comments on commit 026cf77

Please sign in to comment.