[PATCH] LLD: Use std::vector to store SimpleReferences instead of linked list.

Jean-Daniel Dupas mailing at xenonium.com
Mon Mar 9 15:46:43 PDT 2015


SimpleReference was implemented using a vector not so long ago, but that design choice was made because std::vector is not bumpPtrAllocator friendly.
Mach-O implementation (at least) uses a bumpPtrAllocator to allocate the SimpleReferences. So SimpleReference destructor is never call, and so are members destructor.
If you use a std::vector, it means you will leak the vector storage memory. As all ilist nodes are allocated using the bumpPtr allocator, we don’t have that issue.


http://reviews.llvm.org/D8182

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list