1
0
Fork 0
mirror of https://forgejo.ellis.link/continuwuation/continuwuity.git synced 2025-08-04 11:43:58 +00:00

start mallctl suite w/ jemalloc stats

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-04-27 04:50:20 -07:00 committed by June
parent 56f652c12d
commit e4b669360f
9 changed files with 101 additions and 14 deletions

20
src/alloc/mod.rs Normal file
View file

@ -0,0 +1,20 @@
pub(crate) mod hardened;
pub(crate) mod je;
#[cfg(all(not(target_env = "msvc"), feature = "hardened_malloc", target_os = "linux", not(feature = "jemalloc")))]
pub(crate) fn memory_usage() -> String { hardened::memory_usage() }
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc", not(feature = "hardened_malloc")))]
pub(crate) fn memory_usage() -> String { je::memory_usage() }
#[cfg(any(target_env = "msvc", all(not(feature = "jemalloc"), not(feature = "hardened_malloc"))))]
pub(crate) fn memory_usage() -> String { String::default() }
#[cfg(all(not(target_env = "msvc"), feature = "hardened_malloc", target_os = "linux", not(feature = "jemalloc")))]
pub(crate) fn memory_stats() -> String { hardened::memory_stats() }
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc", not(feature = "hardened_malloc")))]
pub(crate) fn memory_stats() -> String { je::memory_stats() }
#[cfg(any(target_env = "msvc", all(not(feature = "jemalloc"), not(feature = "hardened_malloc"))))]
pub(crate) fn memory_stats() -> String { String::default() }