<div dir="ltr">I think SmallVector guarantees the array it contains is contiguous in memory. That data structure does not work well with BumpPtrAllocator because garbage after extending the array is not reclaimed until the whole buffer is discarded. That makes memory consumption of a small vector from O(n) to O(n^2).<div><br></div><div>That being said, that behavior might be acceptable if we rarely extend SmallVectors. So, maybe it's not a bad idea, but I don't know if it's good enough to add an additional parameter to SmallVector's constructor.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 15, 2015 at 10:49 PM, Yaron Keren <span dir="ltr"><<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This may mean we need teach SmallVector to accept allocator like other ADT.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<a href="http://reviews.llvm.org/D8182" target="_blank">http://reviews.llvm.org/D8182</a><br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
</div></div></blockquote></div><br></div>