region
Fil-C also object
Upstream InvisiCaps, filc_runtime.h
An object is one allocation a capability can name, its bytes what upstream calls the payload: a heap object, a named local, a data item or a variadic argument snapshot. A region is the model's record of it, regionBase, End, Kind, Life: its bounds [Base, End), its kind (stack, heap or global data) and whether it is live or freed.
interp.pl keeps the regions in
memBytes, Regions, Next, Aux; Memory.v hasregionwithkindandlife, listed inmem'sm_regions. Next is not part of the model's memory: the runtime keeps it.Only an ending changes a region: End becomes Base and Life becomes freed. Free does this to a live heap object (
lifetime_step); the end of an invocation does it to its locals (region_step). Bytes and stored capabilities stay where they were.An object is what
object_region(interp:object_region/3) finds for a base: the first region with that base. A later region of the same identity is no object, and the proofs (fresh,persists,objects_fit) speak of objects only this way.
The subtlety: a live zero-sized object also has End = Base, so empty bounds do not mean freed. Only the converse holds, freed implies empty (freed_empty), and freed_bounds asks it of every ready memory.
Linked from
- Buffer.v: buffer_module
- Evidence.v: check_passes_regions
- ExternalCalls.v: writable_span
- How Fil-C works: Pointers carry capabilities
- Identity.v: ids
- Memory.v: reason
- Memory.v: region
- Runtime.v: collector_live
- Runtime.v: freed_in
- Sum.v: mem_ok
- Sum.v: sum_module
- Validate.v: hull_covered
- Walk.v: access_res_obj
- capability
- lower
- meta
- spares