Skip to main content

Module heap

Module heap 

Source
Expand description

Persistent heap of mutable cells.

The heap is a BTreeMap from monotonically-allocated Addresses to Values. Every operation that conceptually mutates the heap (alloc, store, retain) instead returns a new Heap value; the receiver is left untouched. No Rc, Arc, RefCell, Cell, or Mutex is used to provide shared mutability.

The trade-off is performance: each non-read operation clones the existing cell map. This is acceptable for a falsification spike and an explicit mirror of the persistent-data-structure pattern that the user’s no- interior-mutability rule pushes the design toward.

Structs§

Address
An address of a cell on the heap.
Heap
A persistent map of addresses to cell values.