From 0e9e34a519e9ed181295a1c7f3ead584d62149a6 Mon Sep 17 00:00:00 2001 From: Anand Krishnamoorthi <35780660+anakrish@users.noreply.github.com> Date: Fri, 30 Jan 2026 23:56:29 +0530 Subject: [PATCH] chore: Gate exports using allocator-limits feature (#564) This is needed to publish regorus-mimalloc Signed-off-by: Anand Krishnamoorthi --- mimalloc/src/lib.rs | 1 + mimalloc/src/mimalloc.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mimalloc/src/lib.rs b/mimalloc/src/lib.rs index 42b9f21..67e2919 100644 --- a/mimalloc/src/lib.rs +++ b/mimalloc/src/lib.rs @@ -4,6 +4,7 @@ #[cfg(not(any(target_family = "wasm")))] pub mod mimalloc; +#[cfg(feature = "allocator-memory-limits")] #[cfg(not(any(target_family = "wasm")))] pub use mimalloc::{ allocation_stats_snapshot, current_thread_allocation_stats, global_allocation_stats_snapshot, diff --git a/mimalloc/src/mimalloc.rs b/mimalloc/src/mimalloc.rs index a7583cc..74f42e4 100644 --- a/mimalloc/src/mimalloc.rs +++ b/mimalloc/src/mimalloc.rs @@ -29,9 +29,9 @@ unsafe impl GlobalAlloc for Mimalloc { } #[inline] - unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { + unsafe fn dealloc(&self, ptr: *mut u8, _layout: Layout) { #[cfg(feature = "allocator-memory-limits")] - record_free(layout.size()); + record_free(_layout.size()); mi_free(ptr.cast::()); }