Jeff King writes:
>> /**
>> * Release a string buffer and the memory it used. You should not use the
>> - * string buffer after using this function, unless you initialize it again.
>> + * string buffer after using this function.
>> */
>> extern void strbuf_release(struct
On Tue, Oct 03, 2017 at 03:24:14PM -0700, Jonathan Nieder wrote:
> Here's a patch to address the surprising strbuf.h advice.
>
> -- >8 --
> Subject: strbuf: do not encourage init-after-release
>
> strbuf_release already leaves the strbuf in a valid, initialized
> state, so there is not need to
Hi,
Stefan Beller wrote:
> Our documentation advises to not re-use a strbuf, after strbuf_release
> has been called on it. Use the proper reset instead.
>
> Reviewed-by: Jonathan Nieder
This is indeed
Reviewed-by: Jonathan Nieder
Thank you.
>
Our documentation advises to not re-use a strbuf, after strbuf_release
has been called on it. Use the proper reset instead.
Currently 'strbuf_release' releases and re-initializes the strbuf, so it
is safe, but slow. 'strbuf_reset' only resets the internal length variable,
such that this could
Hi,
Stefan Beller wrote:
> Our documentation advises to not re-use a strbuf, after strbuf_release
> has been called on it. Use the proper reset instead.
I'm super surprised at this documentation. strbuf_release maintains
the invariant that a strbuf is always usable (i.e., that we do not have
Our documentation advises to not re-use a strbuf, after strbuf_release
has been called on it. Use the proper reset instead.
Signed-off-by: Stefan Beller
---
Maybe one of the #leftoverbits is to remove the re-init call in release
and see what breaks? (And then fixing up more
6 matches
Mail list logo