Skip to content

Commit

Permalink
perf(alloc): forward realloc
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Kröning <[email protected]>
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
SFBdragon and mkroening committed Apr 19, 2024
1 parent 0d71c45 commit 53699a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mm/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")))]
Expand Down

0 comments on commit 53699a1

Please sign in to comment.