ddn.columnar.memory
The memory layer of ddn.df: aligned GC-owned buffers, the single trusted sealing step and the safe typed view (D2, D9, D13; ADR-2026-10-18-07).
All chunk storage goes through allocAligned: zeroed (GC.calloc, fact 5 — GC.malloc hands out stale words, which would corrupt bitmap builders), BlkAttr.NO_SCAN for element types without indirections, over-allocated by BUFFER_ALIGNMENT bytes and returned as the 64-byte aligned interior slice (fact 3 — the collector keeps an interior slice alive across collections and GC.addrOf resolves it). Keeping allocation behind one helper is what allows an allocator parameter later.
Copyright
Functions 5
T[] allocAligned(T)(size_t count) @trusted pure nothrowAllocates a zeroed, `BUFFER_ALIGNMENT`-aligned, GC-owned buffer of `count` elements of `T`.T[] allocAlignedRaw(T)(size_t count) @trusted pure nothrowThe unzeroed counterpart of `allocAligned`, for value buffers the caller fully overwrites before anyone can read them (the value runs of the primitive and string builders): null slots hold arbitrar...immutable(T)[] seal(T)(ref T[] buffer) @trusted pure nothrowSeals a mutable builder buffer into immutable chunk storage (D3).immutable(ubyte)[] sealBytes(T)(ref T[] buffer) @trusted pure nothrowSeals a builder buffer and returns it as raw immutable bytes, the form `ArrayData` stores. Always seal through this helper instead of writing `cast(immutable(ubyte)[]) seal(buf)`: GDC 16.2 miscompi...immutable(T)[] typedView(T)(immutable(ubyte)[] raw) @safe pure nothrowReinterprets a sealed byte buffer as typed values (D2). A plain cast of `immutable(ubyte)[]` to `immutable(T)[]` is accepted in `@safe` code under dip1000 on all four compilers, and the runtime ins...Variables 1
BUFFER_ALIGNMENT = 64Every chunk buffer is aligned to this many bytes, so a later zero-copy Arrow C Data Interface or Parquet bridge (the ddn-data-parquet repository) needs no re-layout (D1).