PATCH: Allocate sufficient space for string buffer
Alan Modra
amodra@gmail.com
Fri Jun 8 02:09:00 GMT 2012
On Thu, Jun 07, 2012 at 11:58:45AM -0700, H.J. Lu wrote:
> * input-scrub.c (input_scrub_include_sb): Use sb_build to
> allocate sufficient space for from_sb.
> * read.c (do_repeat): Use sb_build to allocate sufficient space
> for many.
> * sb.c (sb_build): Remove static.
> * sb.h (sb_build): New prototype.
Seems a reasonable optimisation. OK, but
> - sb_new (&many);
> + sb_build (&many, count * one.len + 1);
looks wrong to me. sb_build already adds one to account for the
string terminator.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list