code wiki / (root) / nx_jpegmem_probe.nx

nx_jpegmem_probe.nx

buildroot/runtime/nx_jpegmem_probe.nx

3766 B95 linesdepth 9pulls 21 transitivereach 0 importersview sourcekind probe
docsdependenciesstructsconstsfunctions

about

nx_jpegmem_probe.nx -- INSTRUMENT: does nx_jpeg_decode_rgb overrun/leak per call? Decodes the SAME jpeg N times in one process, printing VmRSS after each decode, freeing the caller-visible RGB each round. A flat RSS = the lib cleans up; a climbing RSS = per-call arena growth (the OOM suspect for the 12-decode toon run); ARENA-OVERRUN lines localize the write. usage: nx_jpegmem_probe <file.jpg> <rounds>

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_jpeg_ascii.nx nx_jpegmem_probe.nx

imports: nx_syscalls.nxnx_jpeg_ascii.nx

imported by: nobody (leaf or entry point)

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

main jp_out sys_write jp_slen sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close jp_atoi jp_outn sys_mmap ↻ sys_write ↻ jp_rss sys_mmap ↻ sys_read_file ↻ nx_jpeg_decode_rgb sys_mmap ↻ nx_jpeg_dec_ctx_init sys_mmap ↻ nx_jpeg_ctx_tables_reset nx_jpeg_ctx_htable_at nx_jpeg_ctx_htable_bind

structs

none

consts

none

functions

10func jp_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: jp_out
11func jp_out(s: *u8) -> i64 { sys_write(1, s, jp_slen(s)); return 0 }
called by 1: main calls 2: sys_writejp_slen
12func jp_outn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
25func jp_rss() -> i64
called by 1: main calls 2: sys_mmapsys_read_file
57func jp_atoi(s: *u8) -> i64
called by 1: main
68func main(argc: i64, argv: *i64) -> i64