projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e449f6
)
COFF: Avoid vector reallocation. NFC.
author
Rui Ueyama
<ruiu@google.com>
Fri, 26 Jun 2015 23:51:45 +0000
(23:51 +0000)
committer
Rui Ueyama
<ruiu@google.com>
Fri, 26 Jun 2015 23:51:45 +0000
(23:51 +0000)
llvm-svn: 240859
lld/COFF/InputFiles.cpp
patch
|
blob
|
history
diff --git
a/lld/COFF/InputFiles.cpp
b/lld/COFF/InputFiles.cpp
index
c54ccdd
..
5dc7227
100644
(file)
--- a/
lld/COFF/InputFiles.cpp
+++ b/
lld/COFF/InputFiles.cpp
@@
-57,8
+57,10
@@
std::error_code ArchiveFile::parse() {
File = std::move(ArchiveOrErr.get());
// Allocate a buffer for Lazy objects.
- size_t BufSize = File->getNumberOfSymbols() * sizeof(Lazy);
+ size_t NumSyms = File->getNumberOfSymbols();
+ size_t BufSize = NumSyms * sizeof(Lazy);
Lazy *Buf = (Lazy *)Alloc.Allocate(BufSize, llvm::alignOf<Lazy>());
+ SymbolBodies.reserve(NumSyms);
// Read the symbol table to construct Lazy objects.
uint32_t I = 0;