PATCH] allocateCopy() util for BumpPtrAllocator

Nick Kledzik kledzik at apple.com
Tue Jan 14 13:31:11 PST 2014


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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: BumpPtrAllocator.patch
Type: application/octet-stream
Size: 2938 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140114/2451007a/attachment.obj>
-------------- next part --------------




More information about the llvm-commits mailing list