<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 21, 2014 at 8:31 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@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 id=":3uq" class="a3s" style="overflow:hidden">Store pointers directly to loops inside the nodes.  This could have been<br>

done without changing the type stored in `std::vector<>`.  However,<br>
rather than computing the number of loops before constructing them<br>
(which `LoopInfo` doesn't provide directly), I've switched to a<br>
`vector<unique_ptr<LoopData>>`.<br>
<br>
This adds some heap overhead, but the number of loops is typically<br>
small.</div></blockquote></div><br>The other option is to use a BumpPtrAllocator rather than a unique_ptr to batch the allocation and clearing. Not sure its warranted here, just wanted to mention it.</div></div>