<div dir="ltr">I think Colin's calculation is correct. That makes me think of whether or not we really want to use BumpPtr allocator at all. We might be trying to optimize too much without knowing if this is important for performance (I could be easily convinced if there's benchmark result). Regular memory allocator shouldn't be that slow, and instead of doing something clever with BumpPtr, we can always use operator new and smart pointers.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 4, 2014 at 12:07 PM, <a href="mailto:colinl@codeaurora.org">colinl@codeaurora.org</a> <span dir="ltr"><<a href="mailto:colinl@codeaurora.org" target="_blank">colinl@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It doesn't seem like there's any memory different between the linked list version and the bumpvector version.  The linked list version requires 2*(pointer_size)*N memory and if a bumpvector is resized to double each time, the sum of all intermediate backing allocations comes out the same.<br>
<br>
16 Items in a linked list requires 2*16*pointer<br>
16 Items in a bumpvector requires (1+2+4+8+16)*pointer<br>
<br>
<a href="http://reviews.llvm.org/D6518" target="_blank">http://reviews.llvm.org/D6518</a><br>
<br>
<br>
</blockquote></div><br></div>