#390

Consolidate duplicated dynamic-array grow helpers in zero-c

Open46ki75opened 5mo ago

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;
}

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

0

No activity yet.