Re: [PATCH 1/4] strbuf_split_buf(): use ALLOC_GROW()

2012-11-08 Thread Jeff King
On Tue, Nov 06, 2012 at 08:54:07AM +0100, Michael Haggerty wrote: I suspect this was not used originally because ALLOC_GROW relies on alloc_nr, which does fast growth early on. At (x+16)*3/2, we end up with 24 slots for the first allocation. We are typically splitting 1 or 2 values.

Re: [PATCH 1/4] strbuf_split_buf(): use ALLOC_GROW()

2012-11-05 Thread Michael Haggerty
On 11/04/2012 12:41 PM, Jeff King wrote: On Sun, Nov 04, 2012 at 07:46:51AM +0100, Michael Haggerty wrote: Use ALLOC_GROW() rather than inline code to manage memory in strbuf_split_buf(). Rename pos to nr because it better describes the use of the variable and it better conforms to the

[PATCH 1/4] strbuf_split_buf(): use ALLOC_GROW()

2012-11-04 Thread Michael Haggerty
Use ALLOC_GROW() rather than inline code to manage memory in strbuf_split_buf(). Rename pos to nr because it better describes the use of the variable and it better conforms to the ALLOC_GROW idiom. Also, instead of adding a sentinal NULL value after each entry is added to the list, only add it

Re: [PATCH 1/4] strbuf_split_buf(): use ALLOC_GROW()

2012-11-04 Thread Jeff King
On Sun, Nov 04, 2012 at 07:46:51AM +0100, Michael Haggerty wrote: Use ALLOC_GROW() rather than inline code to manage memory in strbuf_split_buf(). Rename pos to nr because it better describes the use of the variable and it better conforms to the ALLOC_GROW idiom. I suspect this was not used