X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/blobdiff_plain/e2a18bd0eda077f0920274fd114240bc786f03b1..20eb516fdebd2fb901e6a09ffa7e741cfb8e3a83:/dstr.c diff --git a/dstr.c b/dstr.c index 4df8f72..d76ccf5 100644 --- a/dstr.c +++ b/dstr.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: dstr.c,v 1.13 1999/12/22 15:39:28 mdw Exp $ + * $Id: dstr.c,v 1.14 2000/06/17 10:37:39 mdw Exp $ * * Handle dynamically growing strings * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: dstr.c,v $ + * Revision 1.14 2000/06/17 10:37:39 mdw + * Add support for arena management. + * * Revision 1.13 1999/12/22 15:39:28 mdw * Fix overflow in dstr_putline. * @@ -156,9 +159,9 @@ void dstr_ensure(dstr *d, size_t sz) do nsz <<= 1; while (nsz < rq); if (d->buf) - d->buf = xrealloc(d->buf, nsz); + d->buf = x_realloc(d->a, d->buf, nsz); else - d->buf = xmalloc(nsz); + d->buf = x_alloc(d->a, nsz); d->sz = nsz; } @@ -237,7 +240,7 @@ void dstr_putm(dstr *d, const void *p, size_t sz) { DPUTM(d, p, sz); } void dstr_tidy(dstr *d) { - d->buf = xrealloc(d->buf, d->len + 1); + d->buf = x_realloc(d->a, d->buf, d->len + 1); d->buf[d->len] = 0; d->sz = d->len + 1; }