From c320252821e5d9fd6f3a6c26bcc53730aae2a9e1 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 5 Dec 2014 21:13:15 +0000 Subject: obstacks: use obstack_blank_fast where possible. In preparation for gnulib API change to obstacks, where obstack_blank cannot shrink memory use any more. * m4/macro.c (trace_flush): `start - len` can be negative, so call obstack_blank_fast, which accepts negative arguments. * modules/m4.c (m4_make_temp): Likewise... -1 is always negative! Signed-off-by: Gary V. Vaughan --- m4/macro.c | 2 +- modules/m4.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/macro.c b/m4/macro.c index 85aa40bb..01f5f0f8 100644 --- a/m4/macro.c +++ b/m4/macro.c @@ -864,7 +864,7 @@ trace_flush (m4 *context, unsigned int start) fwrite (&str[start], 1, len - start, file); fputc ('\n', file); } - obstack_blank (&context->trace_messages, start - len); + obstack_blank_fast (&context->trace_messages, start - len); } /* Do pre-argument-collection tracing for the macro described in INFO. diff --git a/modules/m4.c b/modules/m4.c index 755bd885..ee973498 100644 --- a/modules/m4.c +++ b/modules/m4.c @@ -732,7 +732,7 @@ m4_make_temp (m4 *context, m4_obstack *obs, const m4_call_info *caller, if (!dir) close (fd); /* Remove NUL, then finish quote. */ - obstack_blank (obs, -1); + obstack_blank_fast (obs, -1); obstack_grow (obs, quotes->str2, quotes->len2); } } -- cgit v1.2.1