<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 14, 2014 at 3:40 PM, Jakob Stoklund Olesen <span dir="ltr"><<a href="mailto:jolesen@apple.com" target="_blank">jolesen@apple.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br>
On Feb 14, 2014, at 3:34 PM, Evan Cheng <<a href="mailto:evan.cheng@apple.com">evan.cheng@apple.com</a>> wrote:<br>
<br>
><br>
> On Feb 14, 2014, at 1:52 PM, Eli Bendersky <<a href="mailto:eliben@google.com">eliben@google.com</a>> wrote:<br>
><br>
>> Hello,<br>
>><br>
>> I was looking at how the memory for MachineBasicBlocks is managed and something seems strange.<br>
>><br>
>> 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.).<br>
>><br>
>> 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.<br>


>><br>
>> Is there some magic I'm missing here, or does this make little sense?<br>
><br>
> Jakob would know for sure. My guess is it takes time to move all the data structure over to the custom allocators so we just tackled the ones that provide the most bang for the buck.<br>
<br>
</div>What Evan said.<br>
<br>
The MachineInstr class is completely heap independent. It would be nice to do the same for MBB, but the gains are small.<br></blockquote><div><br></div><div>Thanks. This makes sense - I just wanted to make sure I'm not missing anything.</div>

<div><br></div><div>EliĀ </div></div></div></div>