Skip to content

Commit 624600e

Browse files
committed
Add mimalloc for windows
1 parent 851c217 commit 624600e

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- os: macos
4545
cargoargs: --features build-cranelift,jemalloc
4646
- os: windows
47-
cargoargs: --features build-cranelift
47+
cargoargs: --features build-cranelift,mimalloc
4848

4949
steps:
5050
- uses: actions/checkout@v2

Cargo.lock

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "rumblebot"
33
version = "0.1.0"
44
authors = ["Anton <[email protected]>", "Noa <[email protected]>"]
55
edition = "2018"
6+
mutually_exclusive_features = ["jemalloc", "mimalloc"]
67

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

5455
sentry = "0.32.2"
5556
jemallocator = { version = "0.5.4", optional = true }
57+
mimalloc = { version = "*", default-features = false, optional = true }
5658

5759
[features]
58-
default = ["build-cranelift", "jemallocator"]
60+
default = ["build-cranelift", "jemalloc"]
5961
build-cranelift = ["wasmer-compiler-cranelift"]
6062
build-llvm = ["wasmer-compiler-llvm", "inkwell", "llvm-sys-120"]
6163
jemalloc = ["jemallocator"]
64+
mimalloc = ["dep:mimalloc"]
6265

6366
[build-dependencies]
6467
wasmer = { version = "2.0", default-features = false, features = ["universal"] }

src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ mod server;
3030
#[global_allocator]
3131
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
3232

33+
#[cfg(feature = "mimalloc")]
34+
#[global_allocator]
35+
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
36+
3337
#[tokio::main]
3438
async fn main() {
3539
env_logger::init();

0 commit comments

Comments
 (0)