mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-13 13:17:26 +08:00
fix jemalloc prof feature (#1201)
This commit is contained in:
@@ -249,7 +249,9 @@ windows-sys = { version = "0.52", features = [
|
|||||||
winapi = { version = "0.3.9", features = ["impl-default"] }
|
winapi = { version = "0.3.9", features = ["impl-default"] }
|
||||||
|
|
||||||
[target.'cfg(not(windows))'.dependencies]
|
[target.'cfg(not(windows))'.dependencies]
|
||||||
jemallocator = { package = "tikv-jemallocator", version = "0.6.0", optional = true }
|
jemallocator = { package = "tikv-jemallocator", version = "0.6.0", optional = true, features = [
|
||||||
|
"unprefixed_malloc_on_supported_platforms"
|
||||||
|
] }
|
||||||
jemalloc-ctl = { package = "tikv-jemalloc-ctl", version = "0.6.0", optional = true, features = [
|
jemalloc-ctl = { package = "tikv-jemalloc-ctl", version = "0.6.0", optional = true, features = [
|
||||||
] }
|
] }
|
||||||
jemalloc-sys = { package = "tikv-jemalloc-sys", version = "0.6.0", features = [
|
jemalloc-sys = { package = "tikv-jemalloc-sys", version = "0.6.0", features = [
|
||||||
|
|||||||
@@ -52,6 +52,11 @@ use jemalloc_ctl::{epoch, stats, Access as _, AsName as _};
|
|||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||||
|
|
||||||
|
#[cfg(feature = "jemalloc-prof")]
|
||||||
|
#[allow(non_upper_case_globals)]
|
||||||
|
#[export_name = "malloc_conf"]
|
||||||
|
pub static malloc_conf: &[u8] = b"prof:true,prof_active:true,lg_prof_sample:19\0";
|
||||||
|
|
||||||
fn set_prof_active(_active: bool) {
|
fn set_prof_active(_active: bool) {
|
||||||
#[cfg(feature = "jemalloc-prof")]
|
#[cfg(feature = "jemalloc-prof")]
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user