hermit::syscalls

Function sys_dealloc

Source
#[no_mangle]
pub unsafe extern "C" fn sys_dealloc(
    ptr: *mut u8,
    size: usize,
    align: usize,
)
Expand description

Interface to deallocate a memory region from the system heap

§Safety

This function is unsafe because undefined behavior can result if the caller does not ensure all of the following:

  • ptr must denote a block of memory currently allocated via this allocator,
  • size and align must be the same values that were used to allocate that block of memory ToDO: verify if the same values for size and align always lead to the same layout

§Errors

May panic if debug assertions are enabled and invalid parameters size or align where passed.