void version_watch_init(struct version_watch *w, struct version *v) { if (needs_grow(v->nw + 1, &v->nwmax)) { v->w = xrealloc(v->w, v->nwmax * sizeof(w)); } v->w[v->nw++] = w; w->counter = v->counter; }
static void maybe_grow (fcache *c) { if (!needs_grow (c)) return; size_t size = c->size == 0 ? fcache_buffer_size : c->size * 2; c->data = XRESIZEVEC (char, c->data, size + 1); c->size = size; }