Skip to main content

sys_heap_get_largest_free_block

Function sys_heap_get_largest_free_block 

Source
pub unsafe extern "C" fn sys_heap_get_largest_free_block(
    heap: *mut sys_heap,
    bytes: *mut usize,
) -> i32
Expand description

@brief Get the size of the largest free block in a sys_heap

Writes to @a bytes the number of usable bytes available in the single largest contiguous free block currently in the heap: the largest value that could currently be passed to sys_heap_alloc() and still succeed, absent further fragmentation from intervening allocations or frees.

@param heap Pointer to specified sys_heap @param bytes Pointer to size_t to store the result in @return -EINVAL if null pointers, otherwise 0