[COFF] Free some memory used for chunks
authorReid Kleckner <rnk@google.com>
Tue, 2 Jun 2020 01:46:51 +0000 (18:46 -0700)
committerReid Kleckner <rnk@google.com>
Tue, 2 Jun 2020 01:51:47 +0000 (18:51 -0700)
commit11d1aa0bcc1197f1b3010171b02c6e9662f34b75
treeea09614544874c3a5ee5955ba97a9490508c65f7
parenta0b674fd7f06b86241cf19387313b508248a3868
[COFF] Free some memory used for chunks

First, do not reserve numSections in the Chunks array. In cases where
there are many non-prevailing sections, this will overallocate memory
which will not be used.

Second, free the memory for sparseChunks after initializeSymbols. After
that, it is never used.

This saves 50MB of 627MB for my use case without affecting performance.
lld/COFF/InputFiles.cpp
lld/COFF/InputFiles.h