Struct CellRegistryHooks

Struct Documentation

struct CellRegistryHooks

Wiring CellRegistry needs from its owner (the ordered executor’s Stage-3 storage move) but must not construct itself: the cross-call PersistentValueStore (a CacheManager member, one instance per top-level evaluation call, outliving any one CellRegistry), the map from a table value id to the canonical hash that the store and the CacheManager scope caches both key persistence on, and an optional metering hook. Every field defaults to “off”: a CellRegistry built with a default-constructed CellRegistryHooks does no persistence or bytes tracking (persistent cells are never seeded or published, and live_bytes stays a bookkeeping-only counter nobody observes).

Public Members

PersistentValueStore *persistent = nullptr

Cross-call persistence store; seed_persistent reads it, set publishes to it. Null disables both.

std::function<std::size_t(std::size_t value_id)> hash_of

A table value id’s canonical hash, the key persistent is addressed by. Required (alongside persistent) for seeding/publishing; a null function disables both exactly as a null persistent does.

std::function<void(std::size_t live_bytes)> on_bytes_changed

Metering: invoked with the new live_bytes total after every change. May be empty &#8212; CellRegistry does not require a metering consumer.

bool strict_fill_once = eval::strict_fill_once()

Whether a fill-once violation throws (see CellRegistry::set). The default is the process-wide env gate eval::strict_fill_once(), which is latched on its first call anywhere in the process &#8212; so a test that needs strictness sets this field instead of the environment, which by then may be too late to have any effect.