[ELF] Improve 2 SmallVector<*, N> usage

For --gc-sections, SmallVector<InputSection *, 256> -> SmallVector<InputSection *, 0> because the code bloat (1296 bytes) is not worthwhile (the saved reallocation is negligible).
For OutputSection::compressedData, N=1 is useless (for a compressed .debug_*, the size is always larger than 1).
This commit is contained in:
Fangrui Song 2020-11-29 14:01:32 -08:00
parent 891170e863
commit dfcf1acf13
2 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ private:
unsigned partition;
// A list of sections to visit.
SmallVector<InputSection *, 256> queue;
SmallVector<InputSection *, 0> queue;
// There are normally few input sections whose names are valid C
// identifiers, so we just store a std::vector instead of a multimap.

View File

@ -111,7 +111,7 @@ public:
private:
// Used for implementation of --compress-debug-sections option.
std::vector<uint8_t> zDebugHeader;
llvm::SmallVector<char, 1> compressedData;
llvm::SmallVector<char, 0> compressedData;
std::array<uint8_t, 4> getFiller();
};