mi_malloc_aligned_at

Allocate size bytes aligned by alignment at a specified offset.

extern (C) @nogc pure @system nothrow
void*
mi_malloc_aligned_at
(
size_t size
,
size_t alignment
,
size_t offset
)

Parameters

size
Type: size_t

number of bytes to allocate.

alignment
Type: size_t

the minimal alignment of the allocated memory at offset.

offset
Type: size_t

the offset that should be aligned.

Return Value

Type: void*

pointer to the allocated memory or NULL if out of memory. The returned pointer is aligned by alignment at offset, i.e. ((uintptr_t)p + offset) % alignment == 0.

Returns a unique pointer if called with size 0.

Meta