[llvm-commits] [PATCH] ArrayRecycler

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Jan 4 13:29:39 PST 2013

On Jan 4, 2013, at 1:08 PM, Michael Ilseman <milseman at apple.com> wrote:

> Tweak idea: Allocate N number of objects all at once, so that we're building up our free pool when it's empty. N could even be a template parameter, defaulting to 1. This may not make sense for users that only want to use a BumpPtr allocator, though.
>> - Recycle available arrays larger than the requested size by breaking them into smaller pieces. This could reduce memory usage at the risk of turning into malloc().
> It would also reduce the number of reallocation calls. Again, that may not make sense if the primary use is with a BumpPtr.

Thanks, Michael.

I wasn't really sure if I should even support non-BumpPtr allocators. I only left it in because it is so easy to do. Most systems these days have very good malloc() implementations, and there is little reason to duplicate them unless we get something extra out of it.

In this case, the 'something extra' is the ability to free large tangled data structures by zapping the underlying BumpPtrAllocator.


More information about the llvm-commits mailing list