return (x);
}
-/*----- Resizing arrays ---------------------------------------------------*/
+/*----- Resizing buffers and arrays ---------------------------------------*/
+
+void buf__grow(struct buf *b)
+{
+ b->sz = b->sz ? 2*b->sz : 32;
+ b->p = realloc(b->p, b->sz);
+ if (!b->p) bail("out of memory allocating %zu bytes", b->sz);
+}
void *vec__grow(void *p, size_t esz, size_t *sz_inout)
{