//! Custom memory allocator support.
use std::sync::Once;
static INIT: Once = Once::new();
/// Safe to call multiple times; only the first call has effect.
#[inline]
pub fn init_mimalloc() {
INIT.call_once(|| unsafe {
tg_geom_sys::tg_env_set_allocator(
Some(libmimalloc_sys::mi_malloc),
Some(libmimalloc_sys::mi_realloc),
Some(libmimalloc_sys::mi_free),
);
});
}