MergedAllocation.alloc

Allocate (or count) space needed for numElems elements of type T with given alignment. This gets called twice for each array, see example for usage.

This bumps the internal bump allocator. Giving null to this chain and converting the result to size_t give the total needed size for the merged allocation.

Warning: - If called after a start() call, the area returned are wrong and are only for counting needed bytes. Don't use those.

- If called after an allocate() call, the area returned are an actual merged allocation (if the same calls are done).

Warning: Prefer allocArray over alloc variant, since the extra length field WILL help you catch memory errors before release. Else it is very common to miss buffer overflows in samplerate changes.

struct MergedAllocation
nothrow @nogc
void
alloc
(
T
)
(
out T* array
,
size_t numElems
,
size_t alignment = 1
)

Meta