Compiled allocation #
The allocator writes null pointer fields and undefined scalar fields into the next unused record, preserves all existing records, and advances the allocation pointer. Its running time depends only on the fixed record layout.
theorem Cslib.PointerMachine.WordRAM.Scalars.create_spec {M : Model} {L : Layout} (S : Scalars M L) (r : Fin L.ptrRegs) {w : ℕ} {x : State M L} {y : WordRAM.Data (regCount L)} (h : Repr S.encode x y) (hfit : Fits S.encode w (Instr.effect x (Instr.create r))) :
∃ (z : WordRAM.Data (regCount L)),
WordRAM.ExecWithin w (S.effect (Instr.create r)) y z (S.effectTime (Instr.create r)) ∧ Repr S.encode (Instr.effect x (Instr.create r)) z
The concrete allocator initializes a fresh node and preserves all existing records. Only the resulting state's word bounds are needed, since they also bound the old free address.