fix jemalloc prof feature (#1201)

This commit is contained in:
Sijie.Sun
2025-08-08 17:54:39 +08:00
committed by GitHub
parent e3e406dcde
commit 6d14e9e441
2 changed files with 8 additions and 1 deletions

View File

@@ -249,7 +249,9 @@ windows-sys = { version = "0.52", features = [
winapi = { version = "0.3.9", features = ["impl-default"] }
[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-sys = { package = "tikv-jemalloc-sys", version = "0.6.0", features = [

View File

@@ -52,6 +52,11 @@ use jemalloc_ctl::{epoch, stats, Access as _, AsName as _};
#[global_allocator]
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) {
#[cfg(feature = "jemalloc-prof")]
{