Skip to content

Commit 5bc472a

Browse files
committed
add jemalloc
1 parent 67a41dd commit 5bc472a

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

central/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ thiserror = "2.0.12"
3535
zstd = "0.13.3"
3636
bytes = "1.10.1"
3737

38+
[target.'cfg(not(target_env = "msvc"))'.dependencies]
39+
tikv-jemallocator = "0.5"
40+
3841
[dependencies.rocket_sync_db_pools]
3942
version = "0.1.0"
4043
features = ["diesel_sqlite_pool"]

central/src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ mod schema;
3131
mod state;
3232
mod token_issuer;
3333

34+
#[cfg(all(not(target_env = "msvc"), not(debug_assertions)))]
35+
use tikv_jemallocator::Jemalloc;
36+
37+
#[cfg(all(not(target_env = "msvc"), not(debug_assertions)))]
38+
#[global_allocator]
39+
static GLOBAL: Jemalloc = Jemalloc;
40+
3441
fn abort_misconfig() -> ! {
3542
error!("aborting launch due to misconfiguration.");
3643
std::process::exit(1);

0 commit comments

Comments
 (0)