Join jemalloc background threads prior to exit.

Co-authored-by: Jade Ellis <jade@ellis.link>
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-04-22 06:29:30 +00:00 committed by Jade Ellis
parent 9b8b37f162
commit fcd5669aa1
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
2 changed files with 16 additions and 7 deletions

View file

@ -274,6 +274,10 @@ pub fn set_dirty_decay<I: Into<Option<usize>>>(arena: I, decay_ms: isize) -> Res
}
}
pub fn background_thread_enable(enable: bool) -> Result<bool> {
set::<u8>(&mallctl!("background_thread"), enable.into()).map(is_nonzero!())
}
#[inline]
#[must_use]
pub fn is_affine_arena() -> bool { is_percpu_arena() || is_phycpu_arena() }