Skip to content

Commit ffaea4b

Browse files
committed
Add Jemalloc
1 parent 44022f7 commit ffaea4b

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

Cargo.lock

Lines changed: 21 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ termcolor = "1.4"
5252
textwrap = { version = "0.16", default-features = false }
5353

5454
sentry = "0.32.2"
55+
jemallocator = "0.5.4"
5556

5657
[features]
5758
default = ["build-cranelift"]

src/main.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ mod api;
2626
mod display;
2727
mod server;
2828

29+
#[global_allocator]
30+
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
31+
2932
#[tokio::main]
3033
async fn main() {
3134
env_logger::init();
@@ -288,7 +291,6 @@ impl Runner {
288291
let (module, version) = lang.get_wasm(store)?;
289292
// This is very strange, but this exactly println in this exact place is necessary to avoid
290293
// error: "corrupted binary: misaligned metadata"
291-
println!("IT worked");
292294
Runner::new_wasm(store, module, version, &[], sourcedir).await
293295
}
294296
RobotId::Command { command, args } => {
@@ -638,9 +640,6 @@ impl Lang {
638640
}};
639641
}
640642
let lang = self;
641-
// This is very strange, but this exactly println in this exact place is necessary to avoid
642-
// error: "corrupted binary: misaligned metadata"
643-
println!("ATTEMPTING");
644643
Ok(include!(concat!(env!("OUT_DIR"), "/lang_runners.rs")))
645644
}
646645
}

0 commit comments

Comments
 (0)