Allocating linked tree nodes #
allocate creates a leaf with its parent from pointer register two and its scalar fields
from supplied data registers. Its execution theorem charges allocation and every field store,
preserves the entire old heap and all registers except cursor zero, and identifies the new leaf.
Attaching the leaf to its parent and rebalancing are separate operations.
Allocate a leaf in cursor register zero, initialize its parent from pointer register two, and copy each scalar field from the specified data register.
Allocation initializes all fields in exactly extra + 4 instructions, including halt.
It appends exactly one record and preserves every register except cursor zero.
The new node is a represented leaf, with the specified parent and complete scalar payload.