[PATCH] D20654: [pdb] Try super hard to conserve memory in llvm-pdbdump

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Thu May 26 16:30:02 PDT 2016

zturner added inline comments.

Comment at: lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp:39-40
@@ +38,4 @@
+  uint32_t BytesInFirstBlock = Pdb.getBlockSize() - OffsetInBlock;
+  // If the entire request can be satisfied from one block, return an
+  // ArrayRef directly into the block.
+  if (BytesInFirstBlock >= Size) {
ruiu wrote:
> How is it likely that a object we want to fetch spans two blocks but the two blocks are contiguous in the file? If it is likely, you might want to optimize for that case. (In that case you don't need to copy contents.)
A quick use of `llvm-pdbdump -raw-stream-blocks` on a large PDB shows this is actually surprisingly common.  In fact, streams blocks are almost always contiguous.  So this will be a really good optimization.  I'll make that change and upload the patch.


More information about the llvm-commits mailing list