[PATCH] D20654: [pdb] Try super hard to conserve memory in llvm-pdbdump
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu May 26 10:51:05 PDT 2016
ruiu added inline comments.
================
Comment at: include/llvm/DebugInfo/CodeView/StreamObject.h:26
@@ +25,3 @@
+ consumeError(std::move(EC));
+ TempValue.reset(new uint8_t[sizeof(T)]);
+ MutableArrayRef<uint8_t> Buf(TempValue.get(), sizeof(T));
----------------
sizeof(T) is a compile-time constant. Do you need to allocate it dynamically?
================
Comment at: lib/DebugInfo/CodeView/StreamReader.cpp:57-60
@@ +56,6 @@
+Error StreamReader::readZeroString(StreamString &Dest) {
+ std::string S;
+ uint32_t OldOff = getOffset();
+ if (auto EC = readZeroString(S))
+ return EC;
+ uint32_t NewOff = getOffset();
----------------
This seems to be copying the string contents to the local std::string object whether the source string is contiguous in memory or not. Am I missing something?
http://reviews.llvm.org/D20654
More information about the llvm-commits
mailing list