code wiki / _hdl_build / nx_seg_cache_gate.nx
nx_seg_cache_gate.nx
buildroot/runtime/_hdl_build/nx_seg_cache_gate.nx
about
nx_seg_cache_gate.nx -- referee for ss_open_cached (debt seq962 / status seq978).
WHAT IS UNDER TEST: ss_open/ss_open2 read EVERY segment fully into anonymous RAM and there is NO
ss_close anywhere in the tree, so a caller that opens PER REQUEST leaks the whole store per request
(MEASURED live: nx_hub_gw 1336 kB/request, VmSize==VmPeak). ss_open_cached memoises the handle and
invalidates on the manifest (st_size, st_mtime), removing the leak WITHOUT ever calling munmap.
T2 IS THE NON-VACUITY TOOTH AND IT IS NOT OPTIONAL: it asserts that BARE ss_open returns DIFFERENT
handles for the same store. If T2 ever fails, T1 is passing for free and this whole gate is theatre.
license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_gate.nxnx_seg_store.nxnx_vsz_watchdog_core.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 26 | const SCG_TEETH: i64 = 9 |
| 27 | const SCG_VM_ITERS: i64 = 200 // open/close cycles driven by the T9 leak tooth |
| 28 | const SCG_VM_SLACK_KB: i64 = 1024 // tolerated VmSize drift across the WHOLE T9 run |
| 29 | const SCG_KB: i64 = 1024 // bytes per kB, for the bytes-per-open magnitude report |
functions
| 17 | func scg_row(name: *u8, ok: i64) -> i64 |
| 30 | func main() -> i64 |