#390
Consolidate duplicated dynamic-array grow helpers in zero-c
The same grow helper is duplicated across 4 files in native/zero-c/src (5 definitions in total):
static void *X_grow_items(void *items, size_t len, size_t *cap, size_t initial, size_t item_size) {
if (len + 1 > *cap) {
*cap = z_grow_capacity(*cap, len + 1, initial);
return z_checked_reallocarray(items, *cap, item_size);
}
return items;
}ir_grow_items— src/ir.c:22lower_grow_items— src/program_graph_lower.c:22checker_grow_items— src/checker.c:160ir_grow_tracked_items(addsir->mir_bytesaccounting) — defined verbatim under the same name in both src/ir.c:30 and src/program_graph_mir.c:18
They're static, so no link conflict — but the duplicated mir_bytes accounting can silently diverge if one copy is edited and the other isn't.
Activity
0No activity yet.