nu_realloc

Reallocates memory prior allocated with nu_malloc or nu_alignedalloc.

This function may re-allocate the memory if resizing the allocation to the new size is not possible.

export extern (C) @nogc nothrow @system pure
@weak
void*
nu_realloc
(
void* data
,
size_t newSize
)

Parameters

data void*

Pointer to prior allocated memory.

newSize size_t

New size of the allocation, in bytes.

Return Value

Type: void*

The address of the reallocated memory or null on failure. To avoid a memory leak, free the memory with nu_free.

Notes: Given the implementation of nu_realloc and nu_free may be independent of the libc allocator, memory allocated with nu_realloc should always be freed with nu_free!

Meta