code wiki / (root) / nx_ioae_confread_test_20260907.nx

nx_ioae_confread_test_20260907.nx

buildroot/runtime/nx_ioae_confread_test_20260907.nx

6055 B118 linesdepth 5pulls 6 transitivereach 1 importersview sourcekind librarytopic ioae
docsdependenciesstructsconstsfunctions

about

TEST ONLY actual heavyio config reader; allocation seams count real 64KiB mappings.

dependencies 1 imports · 1 importers

nx_ioae_lib_test_20260907.nx nx_ioae_confread_test_20260907 nx_ioae_files_test_20260907.nx

imports: nx_ioae_lib_test_20260907.nx

imported by: nx_ioae_files_test_20260907.nx

structs

none

consts

3const HIO_CONF: *u8 = "knowledge/heavyio.conf"
4const HIO_ADMIT: i64 = 1
5const HIO_DEFER: i64 = 0
6const HIO_UNOBSERVABLE: i64 = 0 - 1
7const HIO_MAXP: i64 = 32 // producer rows the conf may carry; the reader announces when it fills
8const HIO_NAMEW: i64 = 64 // one producer needle slot (comm names are 15 bytes; cmdline needles longer)
9const HIO_CONFCAP: i64 = 65536
10const HIO_SPACE: i64 = 32
11const HIO_NL: i64 = 10
12const HIO_HASH: i64 = 35
14const HIO_C_NPROD: i64 = 0
15const HIO_C_SLOTS: i64 = 1
16const HIO_C_FLOOR: i64 = 2
17const HIO_C_MAXC: i64 = 3
18const HIO_C_WMIN: i64 = 4
19const HIO_C_WMAX: i64 = 5
20const HIO_C_FILLED: i64 = 6 // 1 when HIO_MAXP was reached (rows beyond it were NOT read -- announced)
21const HIO_C_TTL: i64 = 7 // slot_ttl <sec>: crash guard for a HUNG-BUT-ALIVE holder (a dead one frees at once)
22const HIO_C_SLOTS_N: i64 = 8
23const HIO_C_BYTES: i64 = 64 // HIO_C_SLOTS_N * 8
26const HIO_O_RUNNING: i64 = 0
27const HIO_O_WIDTH: i64 = 1
28const HIO_O_STORM: i64 = 2
29const HIO_O_SLOT: i64 = 3
30const HIO_OUT_BYTES: i64 = 32
35const HIO_ROOT_A: *u8 = "knowledge/"
36const HIO_ROOT_B: *u8 = "../knowledge/"
37const HIO_CONF_LEAF: *u8 = "heavyio.conf"
38const HIO_LEASE_LEAF: *u8 = "lease/"
39const HIO_SLOT_PFX: *u8 = "heavyio-slot-"
40const HIO_OWNER_PFX: *u8 = "pid"
41const HIO_PROC_PFX: *u8 = "/proc/"
42const HIO_PROC_LEAF: *u8 = "/stat"
43const HIO_PATHCAP: i64 = 256
44const HIO_TTL_DEFAULT: i64 = 900 // used ONLY when the conf carries no slot_ttl row; the conf explains 900
45const HIO_POOL_NONE: i64 = 0 - 1 // every slot held by a LIVE holder -> DEFER
46const HIO_POOL_IO: i64 = 0 - 2 // every slot attempt failed with io (lease root unwritable) -> UNOBSERVABLE, never a stall

functions

52func hio_conf_buffer_alloc() -> *u8
called by 1: hio_conf_read
57func hio_conf_buffer_free(p: *u8) -> i64
called by 1: hio_conf_read
63func hio_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
64func hio_eol(q: *u8, i: i64, n: i64) -> i64 { var e: i64 = i; var s: i64 = 1; while s == 1 { if e >= n { s = 0 } else { if q[e] == (HIO_NL as u8) { s = 0 } else { e = e + 1 } } } return e }
called by 1: hio_conf_read
65func hio_keyis(q: *u8, s: i64, e: i64, key: *u8) -> i64
called by 1: hio_conf_read
72func hio_atoi(q: *u8, s: i64, e: i64) -> i64
called by 1: hio_conf_read
78func hio_slot(names: *u8, i: i64) -> *u8 { return ((names as i64) + i * HIO_NAMEW) as *u8 }
called by 1: hio_conf_read
79func hio_conf_read(path: *u8, cfg: *i64, names: *u8) -> i64