[][src]Function sunrise_libuser::syscalls::set_heap_size

pub unsafe fn set_heap_size(new_size: usize) -> Result<usize, KernelError>

Resize the heap of a process, just like a brk. It can both expand, and shrink the heap.

If new_size == 0, the heap space is entirely de-allocated.

Return

The address of the start of the heap.

Error

Safety

This function can free memory, potentially invalidating references to structs that were in it.