code wiki / _hdl_build / test_munmap.nx

test_munmap.nx

buildroot/runtime/_hdl_build/test_munmap.nx

1084 B22 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic test
docsdependenciesstructsconstsfunctions

about

test_munmap.nx -- verify sys_munmap actually frees. 200k cycles of mmap(1MB)+touch+munmap = 200GB churned; if munmap frees, peak stays ~1MB and it completes; if munmap is a no-op, address space exhausts -> mmap returns <0 and we report failure. expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx test_munmap.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap p sys_write pn sys_mmap ↻ sys_write ↻ sys_munmap sys_exit sys_munmap ↻

structs

none

consts

none

functions

5func p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
6func pn(v: i64) -> i64
called by 1: main calls 3: sys_mmapsys_writesys_munmap
11func main() -> i64