Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions parity-util-mem/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "parity-util-mem"
version = "0.10.1"
version = "0.10.2"
authors = ["Parity Technologies <[email protected]>"]
repository = "https://github.com/paritytech/parity-common"
description = "Collection of memory related utilities"
Expand Down Expand Up @@ -33,12 +33,12 @@ primitive-types = { version = "0.10", path = "../primitive-types", default-featu
[target.'cfg(target_os = "windows")'.dependencies]
winapi = { version = "0.3.8", features = ["heapapi"] }

[target.'cfg(not(target_os = "windows"))'.dependencies.jemallocator]
version = "0.3.2"
[target.'cfg(not(target_os = "windows"))'.dependencies.tikv-jemallocator]
version = "0.4.1"
optional = true

[target.'cfg(not(target_os = "windows"))'.dependencies.jemalloc-ctl]
version = "0.3.3"
[target.'cfg(not(target_os = "windows"))'.dependencies.tikv-jemalloc-ctl]
version = "0.4.2"
optional = true

[features]
Expand All @@ -49,7 +49,7 @@ dlmalloc-global = ["dlmalloc", "estimate-heapsize"]
# use wee_alloc as global allocator
weealloc-global = ["wee_alloc", "estimate-heapsize"]
# use jemalloc as global allocator
jemalloc-global = ["jemallocator", "jemalloc-ctl"]
jemalloc-global = ["tikv-jemallocator", "tikv-jemalloc-ctl"]
# use mimalloc as global allocator
mimalloc-global = ["mimalloc", "libmimalloc-sys"]
# implement additional types
Expand Down
6 changes: 3 additions & 3 deletions parity-util-mem/src/allocators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
//! - mimalloc: use mimallocator crate
//! - arch x86:
//! - no features: use default alloc
//! - jemalloc: use jemallocator crate
//! - jemalloc: use tikv-jemallocator crate
//! - weealloc: default to `estimate_size`
//! - dlmalloc: default to `estimate_size`
//! - mimalloc: use mimallocator crate
//! - arch x86/macos:
//! - no features: use default alloc, requires using `estimate_size`
//! - jemalloc: use jemallocator crate
//! - jemalloc: use tikv-jemallocator crate
//! - weealloc: default to `estimate_size`
//! - dlmalloc: default to `estimate_size`
//! - mimalloc: use mimallocator crate
Expand Down Expand Up @@ -85,7 +85,7 @@ mod usable_size {

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

} else if #[cfg(feature = "mimalloc-global")] {
Expand Down
2 changes: 1 addition & 1 deletion parity-util-mem/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cfg_if::cfg_if! {
))] {
/// Global allocator
#[global_allocator]
pub static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
pub static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

mod memory_stats_jemalloc;
use memory_stats_jemalloc as memory_stats;
Expand Down
6 changes: 3 additions & 3 deletions parity-util-mem/src/memory_stats_jemalloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

pub use jemalloc_ctl::Error;
use jemalloc_ctl::{epoch, stats};
pub use tikv_jemalloc_ctl::Error;
use tikv_jemalloc_ctl::{epoch, stats};

#[derive(Clone)]
pub struct MemoryAllocationTracker {
epoch: jemalloc_ctl::epoch_mib,
epoch: tikv_jemalloc_ctl::epoch_mib,
allocated: stats::allocated_mib,
resident: stats::resident_mib,
}
Expand Down