Function libmimalloc_sys::mi_malloc_aligned_at

source ยท
pub unsafe extern "C" fn mi_malloc_aligned_at(
    size: usize,
    alignment: usize,
    offset: usize,
) -> *mut c_void
Expand description

Allocate size bytes aligned by alignment at a specified offset.

Note that the resulting pointer itself is not aligned by the alignment, but after offset bytes it will be. This can be useful for allocating data with an inline header, where the data has a specific alignment requirement.

Specifically, if p is the returned pointer p.add(offset) is aligned to alignment.