Function esp_idf_hal::sys::heap_caps_malloc_prefer

source ยท
pub unsafe extern "C" fn heap_caps_malloc_prefer(
    size: usize,
    num: usize,
    ...
) -> *mut c_void
Expand description

@brief Allocate a chunk of memory as preference in decreasing order.

@attention The variable parameters are bitwise OR of MALLOC_CAP_* flags indicating the type of memory. This API prefers to allocate memory with the first parameter. If failed, allocate memory with the next parameter. It will try in this order until allocating a chunk of memory successfully or fail to allocate memories with any of the parameters.

@param size Size, in bytes, of the amount of memory to allocate @param num Number of variable parameters

@return A pointer to the memory allocated on success, NULL on failure