I don't know enough about BumpPtrAllocator's design/intended use to know how well these new APIs fit - but both the templated forms are unsafe for non-trivial types (ArrayRef<std::string> for argument's sake) which is a bit scary - at least they could have some static assert/SFINAE/something to limit their use to safe cases if they aren't going to be generalized.<br>
<br><div>On Tue Jan 14 2014 at 1:32:28 PM, Nick Kledzik <<a href="mailto:kledzik@apple.com">kledzik@apple.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It is easy to use BumPtrAllocator with placement-new to allocate and initialize a C++ object, but it is harder to allocate and copy other types with BumpPtrAllocator, such as StringRef.  I did not see any helper utils to do that, so I wrote this patch.  I added a few variations of allocateCopy() which each make allocating and copying different types easier.<br>

<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
</blockquote>