count
elements, owned by the GC.
T[] allocAligned(T)(size_t count) @trusted pure nothrowAllocates a zeroed, BUFFER_ALIGNMENT-aligned, GC-owned buffer of count elements of T.
The block is over-allocated by BUFFER_ALIGNMENT bytes and the aligned interior slice returned; the block base pointer is dropped, which is safe because the GC traces interior pointers (fact 3). The block is allocated with BlkAttr.NO_SCAN when T has no indirections, so numeric data is never scanned by the collector. Externally owned memory (mmap, FFI) may be wrapped zero-copy under the caller lifetime contract of ../ddn/doc/DDN-NATIVE-ARRAYS.md D3 instead of going through this helper.
T | the element type the buffer will be used as |
count | number of elements to allocate |
count
elements, owned by the GC.