Skip to content

Commit

Permalink
Add mimalloc for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
outkine committed Mar 26, 2024
1 parent 851c217 commit 624600e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- os: macos
cargoargs: --features build-cranelift,jemalloc
- os: windows
cargoargs: --features build-cranelift
cargoargs: --features build-cranelift,mimalloc

steps:
- uses: actions/checkout@v2
Expand Down
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.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "rumblebot"
version = "0.1.0"
authors = ["Anton <[email protected]>", "Noa <[email protected]>"]
edition = "2018"
mutually_exclusive_features = ["jemalloc", "mimalloc"]

[dependencies]
logic = { path = "../logic/logic" }
Expand Down Expand Up @@ -53,12 +54,14 @@ textwrap = { version = "0.16", default-features = false }

sentry = "0.32.2"
jemallocator = { version = "0.5.4", optional = true }
mimalloc = { version = "*", default-features = false, optional = true }

[features]
default = ["build-cranelift", "jemallocator"]
default = ["build-cranelift", "jemalloc"]
build-cranelift = ["wasmer-compiler-cranelift"]
build-llvm = ["wasmer-compiler-llvm", "inkwell", "llvm-sys-120"]
jemalloc = ["jemallocator"]
mimalloc = ["dep:mimalloc"]

[build-dependencies]
wasmer = { version = "2.0", default-features = false, features = ["universal"] }
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ mod server;
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

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

#[tokio::main]
async fn main() {
env_logger::init();
Expand Down

0 comments on commit 624600e

Please sign in to comment.