[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New versions of openbsd_{basename,dirname}.c



Richard Braun, le Tue 17 Jan 2012 11:20:01 +0100, a écrit :
> On Tue, Jan 17, 2012 at 11:05:37AM +0100, Samuel Thibault wrote:
> > In addition to that, it might be better for performance to rather
> > remember how much memory was previously allocated, and only reallocate
> > if more memory is needed, and twice as much, so as to reduce the amount
> > of free/malloc calls.
> 
> I'd suggest using a base size of e.g. 64 or another power of two close
> to the expected common size, instead of "twice as much".

Why?

Samuel


Reply to: