Expand description
Network encoding of paletted container entries.
Entries are packed like vanilla SimpleBitStorage: 64 / bits entries per long, low
bits first, no entry spanning two longs, longs written big-endian.
StructsΒ§
- Palette
Index πTable - The threadβs index table filled with one palette, reset to empty when dropped (including on unwind) so the next palette starts from a clean table.
ConstantsΒ§
- EMPTY_
SLOT π - Marks an index-table slot whose global id is not in the palette being encoded.
- INDEX_
TABLE_ πLEN - Global ids are
u16-backed, so a table indexed by global id has this many slots. - MAX_
PACKED_ πBYTES - Largest packed payload: a 16Γ16Γ16 section at 16 bits per entry.
- PALETTE_
INDEX π - Palette index per global id, reused across encodes on this thread. It takes 128 KiB on each thread that encodes a section, allocated on first use.
FunctionsΒ§
- invalid_
data π - pack π
- Packs
valuesintobuffer, failing if a value has no entry. - pack_
global_ πids - Packs each valueβs global id into
bufferand returns the packed bytes. - pack_
longs π - Packs
valuesinto the front ofbuffer, failing if a value has no entry. - pack_
palette_ πindices - Packs each valueβs index in
paletteintobufferand returns the packed bytes.