[llvm-commits] [llvm] r171896 - in /llvm/trunk: include/llvm/Support/YAMLTraits.h lib/Support/YAMLTraits.cpp

Chandler Carruth chandlerc at google.com
Tue Jan 8 14:55:03 PST 2013


On Tue, Jan 8, 2013 at 2:44 PM, Nick Kledzik <kledzik at apple.com> wrote:

>
> On Jan 8, 2013, at 2:41 PM, Chandler Carruth wrote:
>
> On Tue, Jan 8, 2013 at 1:04 PM, Nick Kledzik <kledzik at apple.com> wrote:
>
>> Author: kledzik
>> Date: Tue Jan  8 15:04:44 2013
>> New Revision: 171896
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=171896&view=rev
>> Log:
>> Fix memory leak in YAML I/O.
>>
>
> Cool, thanks for looking at this.
>
>
>> Stop using BumpPtrAllocator for HNodes because
>> they have fields (vector, map) which require HNode
>> destructors to be run.
>>
>
> Note that you could instead have all the fields also go on the
> BumpPtrAllocator if this code is performance sensitive.
>
> The fields were std::vector<> and llvm::DenseMap<> which do their own
> internal allocations.  Somehow the destructor needs to run to get those
> allocations cleaned up.  BumpPtrAllocator (as far as I know) does not run
> destructors.
>

Yea, if you'd have to directly go in and do all the allocation w/ the
allocator, and we don't have a good way of doing that today. Bleh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130108/a942d5e3/attachment.html>


More information about the llvm-commits mailing list