Commit 5c299c2f authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Add rust_allocate_zeroed

parent bb9d0d3a
......@@ -40,6 +40,15 @@ pub extern fn __rust_allocate(size: usize, _align: usize) -> *mut u8 {
}
}
#[no_mangle]
pub extern fn __rust_allocate_zeroed(size: usize, align: usize) -> *mut u8 {
use core::ptr;
let ptr = __rust_allocate(size, align);
unsafe { ptr::write_bytes(ptr, 0, size) };
ptr
}
#[no_mangle]
pub extern fn __rust_deallocate(ptr: *mut u8, _size: usize, _align: usize) {
if let Some(ref mut uefi) = get_uefi() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment