code wiki / _hdl_build / nx_galx_compact.nx
nx_galx_compact.nx
buildroot/runtime/_hdl_build/nx_galx_compact.nx
about
nx_galx_compact.nx -- one-shot driver: fold the galx-prod store's many one-seg-per-image segments
into ONE via the cap-aware ss_compact_cap (LM-028), so /img dedup + browse stop re-reading thousands
of seg files per lookup (O(n)->O(1) file opens). Sovereign; the gate _ss_compact_cap_gate proves the
merge is loss-free incl. segments past the 256th. Usage: nx_galx_compact <segid> (segid = a unique
high id for the merged segment, e.g. 9000001; must not collide with an existing seg-<id>). The pre-
compaction live manifest is preserved at galx-prod-manifest.txt.bak.precompact and every retired
segment file stays on disk + is named in galx-prod-manifest-archive.txt = fully reversible.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_seg_store.nxnx_syscalls.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
| 11 | const K_MAGIC_8192: i64 = 8192 |
functions
| 13 | func cp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 14 | func cn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m; sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 } |
| 15 | func c_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ if s[i]>=(48 as u8){ if s[i]<=(57 as u8){ v=v*10+((s[i]-(48 as u8)) as i64) } } i=i+1 } return v } called by 1: main |
| 17 | func main(argc: i64, argv: *i64) -> i64 |