From 01739b338cd802d8b58b97b81a42bb4b903a54c1 Mon Sep 17 00:00:00 2001 From: CalvinNeo Date: Fri, 9 Aug 2024 22:25:21 +0800 Subject: [PATCH 1/2] f Signed-off-by: CalvinNeo --- .../proxy_ffi/src/jemalloc_utils.rs | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/proxy_components/proxy_ffi/src/jemalloc_utils.rs b/proxy_components/proxy_ffi/src/jemalloc_utils.rs index ef94c2340f2..d8114019f68 100644 --- a/proxy_components/proxy_ffi/src/jemalloc_utils.rs +++ b/proxy_components/proxy_ffi/src/jemalloc_utils.rs @@ -63,7 +63,28 @@ pub fn issue_mallctl_args( #[cfg(not(feature = "external-jemalloc"))] { // Happens only with `raftstore-proxy-main` - return mallctl(c_ptr, oldptr, oldsize, newptr, newsize); + #[cfg(not(any(test, feature = "testexport")))] + { + // No test part + #[cfg(feature = "external-jemalloc")] + { + // Must linked to tiflash. + return mallctl(c_ptr, oldptr, oldsize, newptr, newsize); + } + #[cfg(not(feature = "external-jemalloc"))] + { + // Happens only with `raftstore-proxy-main` + #[cfg(not(any( + target_os = "android", + target_os = "dragonfly", + target_os = "macos" + )))] + { + return mallctl(c_ptr, oldptr, oldsize, newptr, newsize); + } + 0 + } + } } } } From 6e6035c2a4798616c3b697a07cf0c5fe5faa9802 Mon Sep 17 00:00:00 2001 From: CalvinNeo Date: Fri, 9 Aug 2024 22:41:02 +0800 Subject: [PATCH 2/2] 2 Signed-off-by: CalvinNeo --- .../proxy_ffi/src/jemalloc_utils.rs | 27 +++++-------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/proxy_components/proxy_ffi/src/jemalloc_utils.rs b/proxy_components/proxy_ffi/src/jemalloc_utils.rs index d8114019f68..763669fffd5 100644 --- a/proxy_components/proxy_ffi/src/jemalloc_utils.rs +++ b/proxy_components/proxy_ffi/src/jemalloc_utils.rs @@ -63,28 +63,15 @@ pub fn issue_mallctl_args( #[cfg(not(feature = "external-jemalloc"))] { // Happens only with `raftstore-proxy-main` - #[cfg(not(any(test, feature = "testexport")))] + #[cfg(not(any( + target_os = "android", + target_os = "dragonfly", + target_os = "macos" + )))] { - // No test part - #[cfg(feature = "external-jemalloc")] - { - // Must linked to tiflash. - return mallctl(c_ptr, oldptr, oldsize, newptr, newsize); - } - #[cfg(not(feature = "external-jemalloc"))] - { - // Happens only with `raftstore-proxy-main` - #[cfg(not(any( - target_os = "android", - target_os = "dragonfly", - target_os = "macos" - )))] - { - return mallctl(c_ptr, oldptr, oldsize, newptr, newsize); - } - 0 - } + return mallctl(c_ptr, oldptr, oldsize, newptr, newsize); } + 0 } } }