Home

[Allocator] Switch the BumpPtrAllocator to use a vector of pointers to

Press ? to show keyboard shortcuts.
Committed
chandlercApr 13 2014, 8:55 PM
Parents
rL206146: tools: simplify symbol handling in objdump
Branches
Unknown
Tags
Unknown
Subscribers
None
Projects
None
Description

[Allocator] Switch the BumpPtrAllocator to use a vector of pointers to
slabs rather than embedding a singly linked list in the slabs
themselves. This has a few advantages:

  • Better utilization of the slab's memory by not wasting 16-bytes at the front.
  • Simpler allocation strategy by not having a struct packed at the front.
  • Avoids paging every allocated slab in just to traverse them for deallocating or dumping stats.

The latter is the really nice part. Folks have complained from time to
time bitterly that tearing down a BumpPtrAllocator, even if it doesn't
run any destructors, pages in all of the memory allocated. Now it won't.

]

Also resolves a FIXME with the scaling of the slab sizes. The scaling
now disregards specially sized slabs for allocations larger than the
threshold.

rL206147

llvm/trunk/include/llvm/Support/Allocator.h

Loading...

llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp

Loading...

llvm/trunk/lib/Support/Allocator.cpp

Loading...

llvm/trunk/unittests/Support/AllocatorTest.cpp

Loading...

Add Comment