[PATCH] D27960: Use exact vector capacities to store DWARF line tables

Simon Que via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 17:30:42 PST 2016


sque updated this revision to Diff 82048.
sque added a comment.

Fixed typo: s/memroy/memory


https://reviews.llvm.org/D27960

Files:
  lib/DebugInfo/DWARF/DWARFDebugLine.cpp


Index: lib/DebugInfo/DWARF/DWARFDebugLine.cpp
===================================================================
--- lib/DebugInfo/DWARF/DWARFDebugLine.cpp
+++ lib/DebugInfo/DWARF/DWARFDebugLine.cpp
@@ -520,6 +520,11 @@
     // rudimentary sequences for address ranges [0x0, 0xsomething).
   }
 
+  // There could be hundreds or thousands of Rows in the line table. The vector
+  // will likely have an internal reserved memory block that is much bigger
+  // than necessary. Reduce the reserved capacity to conserve memory.
+  Rows.shrink_to_fit();
+
   return end_offset;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27960.82048.patch
Type: text/x-patch
Size: 580 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161220/5861ded2/attachment.bin>


More information about the llvm-commits mailing list