riot_sys::bindgen

Function measure_stack_free_internal

Source
pub unsafe extern "C" fn measure_stack_free_internal(
    stack: *const c_char,
    size: size_t,
) -> usize
Expand description

@brief Measures the stack usage of a stack @internal Should not be used externally

Only works if the stack is filled with canaries (*((uintptr_t *)ptr) == (uintptr_t)ptr for naturally aligned ptr within the stack). This is enabled if DEVELHELP or SCHED_TEST_STACK is set.

@param[in] stack the stack you want to measure. Try thread_get_stackstart(thread_get_active()) @param[in] size size of @p stack in bytes

@return the amount of unused space of the thread’s stack