Skip to main content

Module region

Module region 

Source
Expand description

Storage for the assertion + each-bucket regions.

By default the regions are heap-allocated by init — portable everywhere (wasm, macOS, Linux), single process, no sharing. An exploration backend that needs cross-fork sharing calls install_region with MAP_SHARED pointers it owns; this crate then accounts into that memory and clears its view when the backend frees it.

Pointers are thread-locals set before forking, so forked children inherit them (the MAP_SHARED region is the same physical memory in parent and child).

Functions§

assertion_table_ptr
Get the raw pointer to the assertion table region (null if uninitialized).
clear
Drop this crate’s view of the regions. Frees heap regions it owns; for installed (external) regions it only nulls the pointers — the backend frees its own memory.
each_bucket_ptr
Get the raw pointer to the each-bucket region (null if uninitialized).
init
Allocate the regions on the heap (zeroed). Idempotent: a no-op if a region is already present (whether heap-owned or installed by a backend).
install_region
Point accounting at caller-owned regions (e.g. MAP_SHARED memory from an exploration backend). The caller owns the memory and is responsible for freeing it after calling clear. Frees any heap regions this crate previously allocated.
prepare_next_seed_reset
Reset only the per-seed split triggers, preserving pass/fail counts and watermarks/frontiers across seeds (coverage-preserving multi-seed reset).
reset
Zero both regions for a between-run reset. No-op if not initialized.