http://llvm.org/bugs/show_bug.cgi?id=21682

            Bug ID: 21682
           Summary: TrieEdge leak in MachONormalizedFileBinaryWriter.cpp
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

TrieNode uses a SmallVector to store TrieEdge children.
But TrieNode is allocated using an llvm::bumpPtr allocator, and so its
destructor is never invoked when the memory is freed. As a result the
SmallVector destructor is never call either, and as the SmallVector is not
allocator aware, the memory managed by the SmallVector leaks.

A possible solution would be to use an other structure to store the TrieEdge
(chained list) that does not require additional memory allocation.
TrieEdge will contain a pointer to its sibling, and will be allocated using the
llvm bumpPtr allocator.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to