Re: [PATCH V2 3/3] strbuf: allow to use preallocated memory
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 8, 2016, 18:07 UTC
- Message-ID
- <xmqqziqvlfk6.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <575845D9.2010604@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 8 quoted lines
> * It's a little less manual bookkeeping, and thus less error-prone, > than the current code. > > * If somebody decides to add another character to the line but > forgets to increase the allocation size, the code dies in testing > rather than (a) overflowing the buffer, like the current > code, or (b) silently becoming less performant, as if it used a > preallocated but non-fixed strbuf.
Yeah, thanks. A relization of pretty much the same came to me after I wrote my last message on this topic. The above two are attractive.