seal

fnimmutable(T)[] seal(T)(ref T[] buffer) @trusted pure nothrow

Seals a mutable builder buffer into immutable chunk storage (D3).

This is the single @trusted assume-unique step of the package (with allocAligned, one of the only two @trusted sites, D13). Invariant, stated here because the compiler cannot check it: the caller has dropped every mutable alias to the buffer's contents before calling — the builder's own slice is the last one, and this function nulls it, so no mutable alias to sealed data survives. Operations never mutate a chunk; they produce new chunks.

Parameters

bufferthe builder's mutable slice; nulled by this call

Returns

the same memory as an immutable(T)[] slice.