mi_malloc_aligned

Allocate size bytes aligned by alignment.

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

Parameters

size size_t

number of bytes to allocate.

alignment size_t

the minimal alignment of the allocated memory.

Return Value

Type: void*

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

Returns a unique pointer if called with size 0.

Meta