From 53699a1ce62da2fbcd85031a17b6012a45b2e0a6 Mon Sep 17 00:00:00 2001 From: Shaun Beautement Date: Fri, 19 Apr 2024 14:29:08 +0200 Subject: [PATCH] perf(alloc): forward `realloc` 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 04f78b4872..b9f2147c85 100644 --- a/src/mm/allocator.rs +++ b/src/mm/allocator.rs @@ -50,6 +50,11 @@ unsafe impl GlobalAlloc for LockedAllocator { let layout = Self::align_layout(layout); unsafe { self.0.alloc_zeroed(layout) } } + + unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { + let layout = Self::align_layout(layout); + unsafe { self.0.realloc(ptr, layout, new_size) } + } } #[cfg(all(test, not(target_os = "none")))]