[cfe-commits] [PATCH] Fix Numeric literals leaks

Argyrios Kyrtzidis kyrtzidis at apple.com
Tue Aug 24 18:01:09 PDT 2010


The attached patch fixes the leaks of FloatingLiteral/IntegerLiteral.

For large floats/integers, APFloat/APInt will allocate memory from the heap to represent these numbers. 
Unfortunately, when we use a BumpPtrAllocator to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with
the APFloat/APInt values will never get freed.
I introduce the class 'APNumericStorage' which uses ASTContext's allocator for memory allocation and is used internally by FloatingLiteral/IntegerLiteral.

Please review.

-Argiris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: numeric_leak_fix.diff
Type: application/octet-stream
Size: 18919 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100825/da7e6253/attachment.obj>


More information about the cfe-commits mailing list