ConservativeGC.realloc

void *realloc realloc(void * p, size_t size, uint bits = 0, const TypeInfo ti = null) nothrow

Request that the GC reallocate a block of memory, attempting to adjust the size in place if possible. If size is 0, the memory will be freed.

If p was not allocated by the GC, points inside a block, or is null, no action will be taken.

Parameters

pA pointer to the root of a valid memory block or to null.
sizeThe desired allocation size in bytes.
bitsA bitmask of the attributes to set on this block. APPENDABLE and FINALIZE are not allowed for realloc.
tiTypeInfo to describe the memory.

Returns

A reference to the allocated memory on success or null if size is

zero.

Throws

OutOfMemoryError on allocation failure.