summaryrefslogtreecommitdiff
path: root/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/DebugInfo/CodeView/SymbolSerializer.h')
-rw-r--r--include/llvm/DebugInfo/CodeView/SymbolSerializer.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/DebugInfo/CodeView/SymbolSerializer.h b/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
index b63ced5217b44..f4d8ab0c3c2ed 100644
--- a/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
+++ b/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
@@ -28,7 +28,10 @@ namespace codeview {
class SymbolSerializer : public SymbolVisitorCallbacks {
BumpPtrAllocator &Storage;
- std::vector<uint8_t> RecordBuffer;
+ // Since this is a fixed size buffer, use a stack allocated buffer. This
+ // yields measurable performance increase over the repeated heap allocations
+ // when serializing many independent records via writeOneSymbol.
+ std::array<uint8_t, MaxRecordLength> RecordBuffer;
MutableBinaryByteStream Stream;
BinaryStreamWriter Writer;
SymbolRecordMapping Mapping;