File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,19 @@ static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
1111// jemalloc configuration for memory profiling with jemalloc_pprof
1212// prof:true,prof_active:true - Enable profiling from start
1313// lg_prof_sample:19 - Sample every 512KB for good detail/overhead balance
14- #[ cfg( feature = "memory-profiling" ) ]
14+
15+ // Linux/other platforms: use unprefixed malloc (with unprefixed_malloc_on_supported_platforms)
16+ #[ cfg( all( feature = "memory-profiling" , not( target_os = "macos" ) ) ) ]
1517#[ allow( non_upper_case_globals) ]
1618#[ export_name = "malloc_conf" ]
1719pub static malloc_conf: & [ u8 ] = b"prof:true,prof_active:true,lg_prof_sample:19\0 " ;
1820
21+ // macOS: use prefixed malloc (without unprefixed_malloc_on_supported_platforms)
22+ #[ cfg( all( feature = "memory-profiling" , target_os = "macos" ) ) ]
23+ #[ allow( non_upper_case_globals) ]
24+ #[ export_name = "_rjem_malloc_conf" ]
25+ pub static malloc_conf: & [ u8 ] = b"prof:true,prof_active:true,lg_prof_sample:19\0 " ;
26+
1927use std:: {
2028 collections:: { BTreeMap , BTreeSet } ,
2129 env,
Original file line number Diff line number Diff line change @@ -8,11 +8,19 @@ static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
88// jemalloc configuration for memory profiling with jemalloc_pprof
99// prof:true,prof_active:true - Enable profiling from start
1010// lg_prof_sample:19 - Sample every 512KB for good detail/overhead balance
11- #[ cfg( feature = "memory-profiling" ) ]
11+
12+ // Linux/other platforms: use unprefixed malloc (with unprefixed_malloc_on_supported_platforms)
13+ #[ cfg( all( feature = "memory-profiling" , not( target_os = "macos" ) ) ) ]
1214#[ allow( non_upper_case_globals) ]
1315#[ export_name = "malloc_conf" ]
1416pub static malloc_conf: & [ u8 ] = b"prof:true,prof_active:true,lg_prof_sample:19\0 " ;
1517
18+ // macOS: use prefixed malloc (without unprefixed_malloc_on_supported_platforms)
19+ #[ cfg( all( feature = "memory-profiling" , target_os = "macos" ) ) ]
20+ #[ allow( non_upper_case_globals) ]
21+ #[ export_name = "_rjem_malloc_conf" ]
22+ pub static malloc_conf: & [ u8 ] = b"prof:true,prof_active:true,lg_prof_sample:19\0 " ;
23+
1624use std:: { net:: SocketAddr , path:: PathBuf , time:: Duration } ;
1725
1826use anyhow:: { anyhow, bail, ensure, Result } ;
Original file line number Diff line number Diff line change @@ -9,11 +9,19 @@ static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
99// jemalloc configuration for memory profiling with jemalloc_pprof
1010// prof:true,prof_active:true - Enable profiling from start
1111// lg_prof_sample:19 - Sample every 512KB for good detail/overhead balance
12- #[ cfg( feature = "memory-profiling" ) ]
12+
13+ // Linux/other platforms: use unprefixed malloc (with unprefixed_malloc_on_supported_platforms)
14+ #[ cfg( all( feature = "memory-profiling" , not( target_os = "macos" ) ) ) ]
1315#[ allow( non_upper_case_globals) ]
1416#[ export_name = "malloc_conf" ]
1517pub static malloc_conf: & [ u8 ] = b"prof:true,prof_active:true,lg_prof_sample:19\0 " ;
1618
19+ // macOS: use prefixed malloc (without unprefixed_malloc_on_supported_platforms)
20+ #[ cfg( all( feature = "memory-profiling" , target_os = "macos" ) ) ]
21+ #[ allow( non_upper_case_globals) ]
22+ #[ export_name = "_rjem_malloc_conf" ]
23+ pub static malloc_conf: & [ u8 ] = b"prof:true,prof_active:true,lg_prof_sample:19\0 " ;
24+
1725use std:: {
1826 borrow:: Cow ,
1927 num:: NonZeroU16 ,
You can’t perform that action at this time.
0 commit comments