build releases with mimalloc

This commit is contained in:
Scott Lamb
2025-04-03 09:16:04 -07:00
parent 0ccc6d0769
commit 39b6f6c49c
10 changed files with 79 additions and 18 deletions

View File

@@ -75,3 +75,16 @@ impl std::ops::Deref for Condvar {
&self.0
}
}
pub fn ensure_malloc_used() {
#[cfg(feature = "mimalloc")]
{
// This is a load-bearing debug line.
// Building `libmimalloc-sys` with the `override` feature will override `malloc` and
// `free` as used through the Rust global allocator, SQLite, and `libc`. But...`cargo`
// doesn't seem to build `libmimalloc-sys` at all if it's not referenced from Rust code.
tracing::debug!("mimalloc version {}", unsafe {
libmimalloc_sys::mi_version()
})
}
}