Skip to content

Commit 94b1bd8

Browse files
committed
switch jemallocator to its successor tikv-jemallocator
1 parent 62c93b1 commit 94b1bd8

File tree

7 files changed

+76
-36
lines changed

7 files changed

+76
-36
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,9 @@ mio-timer = { git = "https://github.com/Conflux-Chain/mio-timer", rev = "91a02cc
329329
mio-misc = { git = "https://github.com/Conflux-Chain/mio-misc", rev = "27ad80f" }
330330
reqwest = "0.12"
331331

332+
# jemallocator
333+
tikv-jemallocator = "0.6"
334+
332335
# crypto & hash
333336
#fixed-hash = "0.5"
334337
keccak-hash = "0.5"

bins/conflux/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,13 @@ bls-signatures = { workspace = true }
4242
cfx-executor = { workspace = true }
4343
cfx-execute-helper = { workspace = true }
4444

45-
[target.'cfg(not(target_env = "msvc"))'.dependencies.jemallocator]
46-
version = "0.3.2"
47-
optional = true
45+
[target.'cfg(not(target_env = "msvc"))'.dependencies]
46+
tikv-jemallocator = { workspace = true }
4847

4948
[features]
5049
default = ["jemalloc-global"]
5150
deadlock-detection = ["parking_lot/deadlock_detection"]
52-
jemalloc-global = ["jemallocator", "malloc_size_of/jemalloc-global"]
51+
jemalloc-global = ["malloc_size_of/jemalloc-global"]
5352
u64-mpt-db-key = ["client/u64_mpt_db_key"]
5453
# According to Rust's feature unification, when a feature is enabled for a dependency in the root package,
5554
# it will be enabled across all paths depending on that package.

crates/util/malloc_size_of/Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ slab = { workspace = true }
1313
parking_lot = { workspace = true }
1414
smallvec = { workspace = true }
1515

16-
[features]
17-
jemalloc-global = ["jemallocator"]
16+
[target.'cfg(not(target_env = "msvc"))'.dependencies]
17+
tikv-jemallocator = { workspace = true }
1818

19-
[target.'cfg(not(target_env = "msvc"))'.dependencies.jemallocator]
20-
version = "0.3.2"
21-
optional = true
19+
[features]
20+
jemalloc-global = []

crates/util/malloc_size_of/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
//! WebRender.
1313
1414
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc-global"))]
15-
use jemallocator;
16-
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc-global"))]
17-
use jemallocator::Jemalloc;
15+
use tikv_jemallocator::Jemalloc;
1816
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc-global"))]
1917
#[global_allocator]
2018
static GLOBAL: Jemalloc = Jemalloc;
@@ -561,7 +559,7 @@ mod usable_size {
561559

562560
/// Use of jemalloc usable size C function through jemallocator crate call.
563561
pub unsafe extern "C" fn malloc_usable_size(ptr: *const c_void) -> usize {
564-
jemallocator::usable_size(ptr)
562+
tikv_jemallocator::usable_size(ptr)
565563
}
566564

567565
} else if #[cfg(target_os = "linux")] {

tools/consensus_bench/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.

tools/evm-spec-tester/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.

0 commit comments

Comments
 (0)