From df7b858068ec4663af6fd42317206516d644ba4c Mon Sep 17 00:00:00 2001 From: Shaun Beautement Date: Fri, 19 Apr 2024 14:28:18 +0200 Subject: [PATCH] perf(alloc): forward `alloc_zeroed` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Martin Kröning Signed-off-by: Martin Kröning --- src/mm/allocator.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mm/allocator.rs b/src/mm/allocator.rs index 615a3e2c09..04f78b4872 100644 --- a/src/mm/allocator.rs +++ b/src/mm/allocator.rs @@ -45,6 +45,11 @@ unsafe impl GlobalAlloc for LockedAllocator { let layout = Self::align_layout(layout); unsafe { self.0.dealloc(ptr, layout) } } + + unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 { + let layout = Self::align_layout(layout); + unsafe { self.0.alloc_zeroed(layout) } + } } #[cfg(all(test, not(target_os = "none")))]