Expand description
SIGSEGV trap handler for concurrent relocation.
When the GC relocates objects, old regions are protected with PROT_NONE. If the mutator accesses a relocated object before pointer fixup completes, a SIGSEGV fires. The trap handler:
- Checks if the faulting address is in a protected (relocated) region.
- If yes: looks up the forwarding table, updates the pointer, resumes.
- If no: chains to the previous handler (real segfault).
Safety: This is the riskiest component. Initially, relocation is done stop-the-world with synchronous fixup (no trap handler needed). The trap handler is an opt-in feature for concurrent relocation.
Functions§
- clear_
active_ forwarding - Clear the active forwarding table.
- install_
trap_ ⚠handler - Install the SIGSEGV trap handler.
- is_
trap_ handler_ installed - Check if the trap handler is installed.
- register_
protected_ range - Register a protected region range for the trap handler.
- set_
active_ ⚠forwarding - Set the active forwarding table for the trap handler to use.
- unregister_
protected_ range - Unregister a protected region range.