Contiguous

"Tag" struct that wraps a void[] buffer with deserialized contents for the struct of type S. Intended as type-safe tool to guarantee that any operations on such structs preserve the contiguous data layout

Members

Functions

enforceIntegrity
void enforceIntegrity()

Recursively iterates this and all referenced pointers / arrays and verifies that data is indeed contiguous.

length
size_t length()

Length getter.

ptr
S* ptr()

Used to work with Contiguous!(S) as if it was S*:

reset
Contiguous!(S) reset()

Resets length to 0 allowing same buffer to be used as null indicator without creating new GC allocation later

Variables

data
void[] data;

Data buffer that stores deserialized struct data together with all referenced arrays in a single contiguous chunk

Parameters

S

type of the wrapped struct

Meta