[LLVMdev] Custom allocators for MachineBasicBlocks and STL containers

Eli Bendersky eliben at google.com
Fri Feb 14 13:52:05 PST 2014


Hello,

I was looking at how the memory for MachineBasicBlocks is managed and
something seems strange.

On one hand, a MachineFunction uses a recycling allocator to create and
destroy MBBs without costly heap allocation (the same is done for
MachineInstrs, MachineOperands, etc.).

On the other hand, each MBB also has a number of STL vectors within it. For
example, for Predecessors, Successors, Weights, LiveIns. Maintaining these
vectors involves heap allocation and they don't have custom allocators,
AFAICS.

Is there some magic I'm missing here, or does this make little sense?

Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140214/fa3aef2d/attachment.html>


More information about the llvm-dev mailing list