pub unsafe extern "C" fn k_heap_realloc(
h: *mut k_heap,
ptr: *mut c_void,
bytes: usize,
timeout: k_timeout_t,
) -> *mut c_void
Expand description
@brief Reallocate memory from a k_heap
Reallocates and returns a memory buffer from the memory region owned by the heap. If no memory is available immediately, the call will block for the specified timeout (constructed via the standard timeout API, or K_NO_WAIT or K_FOREVER) waiting for memory to be freed. If the allocation cannot be performed by the expiration of the timeout, NULL will be returned. Reallocated memory is aligned on a multiple of pointer sizes.
@note @a timeout must be set to K_NO_WAIT if called from ISR. @note When CONFIG_MULTITHREADING=n any @a timeout is treated as K_NO_WAIT.
@funcprops \isr_ok
@param h Heap from which to allocate @param ptr Original pointer returned from a previous allocation @param bytes Desired size of block to allocate @param timeout How long to wait, or K_NO_WAIT
@return Pointer to memory the caller can now use, or NULL