Skip to content

Commit

Permalink
perf(alloc): forward alloc_zeroed
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
  • Loading branch information
SFBdragon and mkroening committed Apr 20, 2024
1 parent 82e46b7 commit ee9fddf
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 @@ -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")))]
Expand Down

0 comments on commit ee9fddf

Please sign in to comment.