Skip to content

Commit

Permalink
feat: only use mimalloc;
Browse files Browse the repository at this point in the history
  • Loading branch information
mycrl committed Mar 16, 2024
1 parent 135008a commit 986dd49
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 44 deletions.
22 changes: 0 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions turn-balance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,10 @@ bytes = "1.5.0"
log = "0.4.20"
simple_logger = "4.3.0"
num_cpus = "1.15"
mimalloc = { version = "*", default-features = false }

[build-dependencies]
prost-build = "0.12"

[target.'cfg(not(target_os = "windows"))'.dependencies]
jemallocator = "0.5.4"

[target.'cfg(target_os = "windows")'.dependencies]
mimalloc = "0.1.37"

[features]
system_allocator = []
6 changes: 1 addition & 5 deletions turn-balance/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#[global_allocator]
#[cfg(all(target_os = "windows", not(feature = "system_allocator")))]
#[cfg(not(feature = "system_allocator"))]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

#[global_allocator]
#[cfg(all(not(target_os = "windows"), not(feature = "system_allocator")))]
static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;

mod cluster;
mod config;

Expand Down
7 changes: 1 addition & 6 deletions turn-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,10 @@ anyhow = "1.0"
toml = "0.7"
tonic = { version = "0.10", features = ["prost", "gzip", "tls"] }
prost = "0.12"
mimalloc = { version = "*", default-features = false }

[build-dependencies]
tonic-build = "0.10"

[target.'cfg(not(target_os = "windows"))'.dependencies]
jemallocator = "0.5.4"

[target.'cfg(target_os = "windows")'.dependencies]
mimalloc = "0.1.37"

[features]
system_allocator = []
6 changes: 1 addition & 5 deletions turn-server/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#[global_allocator]
#[cfg(all(target_os = "windows", not(feature = "system_allocator")))]
#[cfg(not(feature = "system_allocator"))]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

#[global_allocator]
#[cfg(all(not(target_os = "windows"), not(feature = "system_allocator")))]
static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;

use std::sync::Arc;
use turn_server::config::Config;

Expand Down

0 comments on commit 986dd49

Please sign in to comment.