Re: [PATCH] convert: avoid malloc of original file size

2019-03-07 Thread Jeff King
On Fri, Mar 08, 2019 at 10:26:24AM +0900, Junio C Hamano wrote: > Jeff King writes: > > > As discussed there, I do think this only solves half the problem, as the > > smudge filter has the same issue in reverse. That's more complicated to > > fix, and AFAIK nobody is working on it. But I don't t

Re: [PATCH] convert: avoid malloc of original file size

2019-03-07 Thread Junio C Hamano
Jeff King writes: > As discussed there, I do think this only solves half the problem, as the > smudge filter has the same issue in reverse. That's more complicated to > fix, and AFAIK nobody is working on it. But I don't think there's any > reason not to pick up this part in the meantime. Yeah,

[PATCH] convert: avoid malloc of original file size

2019-03-07 Thread Jeff King
From: Joey Hess We write the output of a "clean" filter into a strbuf. Rather than growing the strbuf dynamically as we read its output, we make the initial allocation as large as the original input file. This is a good guess when the filter is just tweaking a few bytes, but it's disastrous when