GC.expandArrayUsed

bool expandArrayUsed(void[] slice, size_t newUsed, bool atomic = false) nothrow @safe

Expand the array used size in place.

Used for appending and expanding the length of the array slice. If the operation can be performed without reallocating, the function succeeds. Newly expanded data is not initialized. Slices that do not point at expandable GC blocks cannot be affected, and this function will always return false.

Parameters

slicethe slice to attempt expanding in place.
newUsedthe size that should be stored as used.
atomicif true, the array may be shared between threads, and this operation should be done atomically.

Returns

true if successful.