[ELF] Change some global pointers to unique_ptr
Currently the singleton `config` is assigned by `config = make<Configuration>()` and (if `canExitEarly` is false) destroyed by `lld::freeArena`. `make<Configuration>` allocates a stab with `malloc(4096)`. This both wastes memory and bloats the executable (every type instantiates `BumpPtrAllocator` which costs more than 1KiB code on x86-64). (No need to worry about `clang::no_destroy`. Regular invocations (`canExitEarly` is true) call `_Exit` via llvm::sys::Process::ExitNoCleanup.) Reviewed By: lichray Differential Revision: https://reviews.llvm.org/D116143
Loading
Please sign in to comment