Previously, we have a lot of BumpPtrAllocators, but all these
allocators virtually have the same lifetime because they are
not freed until the linker finishes its job. This patch aggregates
them into a single allocator.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
LGTM with nits. We can also do this as is first and then try to free up some memory earlier.
This has small performance fluctuations, no regression or improvement over 1%.
ELF/Driver.h | ||
---|---|---|
65 ↗ | (On Diff #76082) | This one might make sense to remain. We can free it after option parsing, no? |
ELF/DriverUtils.cpp | ||
81 ↗ | (On Diff #76082) | This too can be freed earlier. |
ELF/Memory.h | ||
---|---|---|
31 ↗ | (On Diff #76082) | Global mutable state never seems like a good idea. |
ELF/Memory.h | ||
---|---|---|
31 ↗ | (On Diff #76082) | I disagree. It depends on what you are doing and what your program is. |
ELF/Driver.h | ||
---|---|---|
65 ↗ | (On Diff #76082) | No, we can't. Config may have a StringRef referring a command line argument. |
ELF/DriverUtils.cpp | ||
81 ↗ | (On Diff #76082) | Ditto. (And this is not freed until Driver is freed now, too, because Alloc has the same lifetime as Driver and Driver has the same lifetime as the entire linker.) |
ELF/Memory.h | ||
---|---|---|
31 ↗ | (On Diff #76082) | I believe that in an ecosystem where we want to be able to evolve and innovate, like the LLVM ecosystem, this prevents code reuse, modularity, and future innovation. This is just unacceptable technical debt. |