Skip to main content

Module maintenance

Module maintenance 

Source
Expand description

ECS maintenance subsystem — page compaction (orphan-row reclamation).

A direct maintenance service for the ECS World. Unlike Agents there is no strategy negotiation: it compacts a fixed number of pages per frame to keep frame times predictable. This is the Stage-6 (TickPhase::Maintenance) housekeeping the frame model describes — Data-owned and self-budgeted.

A component migration (add_component / remove_component / remove_component_domain) repoints an entity’s metadata to a new page but leaves the old physical row orphaned, recording the source page in the World’s dirty set (StorageManager::dirty_pages). No migration call site has to remember to forward anything. Each frame EcsMaintenance::tick drains up to max_per_frame dirty pages and compacts them via World::run_compaction, which physically drops the fully-dead rows.

§Usage

use khora_data::ecs::{World, EcsMaintenance};

let mut world = World::new();
let mut maintenance = EcsMaintenance::new();

// Each frame:
maintenance.tick(&mut world);

Structs§

EcsMaintenance
Direct ECS maintenance service.