zephyr::raw

Function k_aligned_alloc

source
pub unsafe extern "C" fn k_aligned_alloc(
    align: usize,
    size: usize,
) -> *mut c_void
Expand description

@brief Allocate memory from the heap with a specified alignment.

This routine provides semantics similar to aligned_alloc(); memory is allocated from the heap with a specified alignment. However, one minor difference is that k_aligned_alloc() accepts any non-zero @p size, whereas aligned_alloc() only accepts a @p size that is an integral multiple of @p align.

Above, aligned_alloc() refers to: C11 standard (ISO/IEC 9899:2011): 7.22.3.1 The aligned_alloc function (p: 347-348)

@param align Alignment of memory requested (in bytes). @param size Amount of memory requested (in bytes).

@return Address of the allocated memory if successful; otherwise NULL.