refactor(pal/hermit): use default impl of `GlobalAlloc::alloc_zeroed` · model-checking/verify-rust-std@8b7f4ee

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())