zephyr::raw

Function k_stack_alloc_init

source
pub unsafe extern "C" fn k_stack_alloc_init(
    stack: *mut k_stack,
    num_entries: u32,
) -> i32
Expand description

@brief Initialize a stack.

This routine initializes a stack object, prior to its first use. Internal buffers will be allocated from the calling thread’s resource pool. This memory will be released if k_stack_cleanup() is called, or userspace is enabled and the stack object loses all references to it.

@param stack Address of the stack. @param num_entries Maximum number of values that can be stacked.

@return -ENOMEM if memory couldn’t be allocated