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

Nick Kledzik kledzik at apple.com
Tue Jan 8 14:44:10 PST 2013


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.

-Nick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130108/f43eb14b/attachment.html>


More information about the llvm-commits mailing list