Skip to content

Commit 8b7f4ee

Browse files
committed
refactor(pal/hermit): use default impl of GlobalAlloc::alloc_zeroed
Signed-off-by: Martin Kröning <[email protected]>
1 parent c337019 commit 8b7f4ee

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

std/src/sys/pal/hermit/alloc.rs

-10
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ unsafe impl GlobalAlloc for System {
99
hermit_abi::malloc(layout.size(), layout.align())
1010
}
1111

12-
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 {
13-
let addr = hermit_abi::malloc(layout.size(), layout.align());
14-
15-
if !addr.is_null() {
16-
ptr::write_bytes(addr, 0x00, layout.size());
17-
}
18-
19-
addr
20-
}
21-
2212
#[inline]
2313
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
2414
hermit_abi::free(ptr, layout.size(), layout.align())

0 commit comments

Comments
 (0)