Skip to content

Subtree Runtime โ€‹

src/tree/subtree.zig: Subtree is a 48-byte-ish plain record; SubtreePool owns nodes and child_indices arrays. Children are (start, count) windows of u32 indices โ€” never pointers โ€” so pools relocate freely and clones rewrite only integers. pushNode/pushChildren are thin ArrayList appends; cloneSubtree (in the parser) pushes the parent record first, then appends children directly into child_indices with backpatched (start, count), avoiding any temporary allocation on the hot path.

Subtrees, Incremental Runtime, Memory Runtime

Released under the MIT License.