Skip to content

Commit

Permalink
Add Jemalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
outkine committed Mar 26, 2024
1 parent 44022f7 commit ffaea4b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
21 changes: 21 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 @@ -52,6 +52,7 @@ termcolor = "1.4"
textwrap = { version = "0.16", default-features = false }

sentry = "0.32.2"
jemallocator = "0.5.4"

[features]
default = ["build-cranelift"]
Expand Down
7 changes: 3 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ mod api;
mod display;
mod server;

#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

#[tokio::main]
async fn main() {
env_logger::init();
Expand Down Expand Up @@ -288,7 +291,6 @@ impl Runner {
let (module, version) = lang.get_wasm(store)?;
// This is very strange, but this exactly println in this exact place is necessary to avoid
// error: "corrupted binary: misaligned metadata"
println!("IT worked");
Runner::new_wasm(store, module, version, &[], sourcedir).await
}
RobotId::Command { command, args } => {
Expand Down Expand Up @@ -638,9 +640,6 @@ impl Lang {
}};
}
let lang = self;
// This is very strange, but this exactly println in this exact place is necessary to avoid
// error: "corrupted binary: misaligned metadata"
println!("ATTEMPTING");
Ok(include!(concat!(env!("OUT_DIR"), "/lang_runners.rs")))
}
}
Expand Down

0 comments on commit ffaea4b

Please sign in to comment.