nx_ioae_confread_v2_20260907.nx
buildroot/runtime/nx_ioae_confread_v2_20260907.nx
about
TEST ONLY actual heavyio config reader; allocation seams count real 64KiB mappings.
dependencies 1 imports · 1 importers
imports: nx_ioae_lib_test_20260907.nx
imported by: nx_ioae_files_v2_20260907.nx
structs
| none |
consts
| 3 | const HIO_CONF: *u8 = "knowledge/heavyio.conf" |
| 4 | const HIO_ADMIT: i64 = 1 |
| 5 | const HIO_DEFER: i64 = 0 |
| 6 | const HIO_UNOBSERVABLE: i64 = 0 - 1 |
| 7 | const HIO_MAXP: i64 = 32 // producer rows the conf may carry; the reader announces when it fills |
| 8 | const HIO_NAMEW: i64 = 64 // one producer needle slot (comm names are 15 bytes; cmdline needles longer) |
| 9 | const HIO_CONFCAP: i64 = 65536 |
| 10 | const HIO_SPACE: i64 = 32 |
| 11 | const HIO_NL: i64 = 10 |
| 12 | const HIO_HASH: i64 = 35 |
| 14 | const HIO_C_NPROD: i64 = 0 |
| 15 | const HIO_C_SLOTS: i64 = 1 |
| 16 | const HIO_C_FLOOR: i64 = 2 |
| 17 | const HIO_C_MAXC: i64 = 3 |
| 18 | const HIO_C_WMIN: i64 = 4 |
| 19 | const HIO_C_WMAX: i64 = 5 |
| 20 | const HIO_C_FILLED: i64 = 6 // 1 when HIO_MAXP was reached (rows beyond it were NOT read -- announced) |
| 21 | const HIO_C_TTL: i64 = 7 // slot_ttl <sec>: crash guard for a HUNG-BUT-ALIVE holder (a dead one frees at once) |
| 22 | const HIO_C_SLOTS_N: i64 = 8 |
| 23 | const HIO_C_BYTES: i64 = 64 // HIO_C_SLOTS_N * 8 |
| 26 | const HIO_O_RUNNING: i64 = 0 |
| 27 | const HIO_O_WIDTH: i64 = 1 |
| 28 | const HIO_O_STORM: i64 = 2 |
| 29 | const HIO_O_SLOT: i64 = 3 |
| 30 | const HIO_OUT_BYTES: i64 = 32 |
| 35 | const HIO_ROOT_A: *u8 = "knowledge/" |
| 36 | const HIO_ROOT_B: *u8 = "../knowledge/" |
| 37 | const HIO_CONF_LEAF: *u8 = "heavyio.conf" |
| 38 | const HIO_LEASE_LEAF: *u8 = "lease/" |
| 39 | const HIO_SLOT_PFX: *u8 = "heavyio-slot-" |
| 40 | const HIO_OWNER_PFX: *u8 = "pid" |
| 41 | const HIO_PROC_PFX: *u8 = "/proc/" |
| 42 | const HIO_PROC_LEAF: *u8 = "/stat" |
| 43 | const HIO_PATHCAP: i64 = 256 |
| 44 | const HIO_TTL_DEFAULT: i64 = 900 // used ONLY when the conf carries no slot_ttl row; the conf explains 900 |
| 45 | const HIO_POOL_NONE: i64 = 0 - 1 // every slot held by a LIVE holder -> DEFER |
| 46 | const HIO_POOL_IO: i64 = 0 - 2 // every slot attempt failed with io (lease root unwritable) -> UNOBSERVABLE, never a stall |
functions
| 52 | func hio_conf_buffer_alloc() -> *u8 called by 1: hio_conf_read |
| 57 | func hio_conf_buffer_free(p: *u8) -> i64 called by 1: hio_conf_read |
| 63 | func hio_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 64 | func 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 |
| 65 | func hio_keyis(q: *u8, s: i64, e: i64, key: *u8) -> i64 called by 1: hio_conf_read |
| 72 | func hio_atoi(q: *u8, s: i64, e: i64) -> i64 called by 1: hio_conf_read |
| 78 | func hio_slot(names: *u8, i: i64) -> *u8 { return ((names as i64) + i * HIO_NAMEW) as *u8 } called by 1: hio_conf_read |
| 79 | func hio_conf_read(path: *u8, cfg: *i64, names: *u8) -> i64 called by 1: main calls 6: hio_conf_buffer_allochio_conf_buffer_freehio_eolhio_keyishio_slothio_atoi |