xref: /llvm-project-15.0.7/lld/Common/Memory.cpp (revision e32ff096)
1 //===- Memory.cpp ---------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "lld/Common/Memory.h"
10 
11 using namespace llvm;
12 using namespace lld;
13 
14 BumpPtrAllocator lld::BAlloc;
15 StringSaver lld::Saver{BAlloc};
16 std::vector<SpecificAllocBase *> lld::SpecificAllocBase::Instances;
17 
18 void lld::freeArena() {
19   for (SpecificAllocBase *Alloc : SpecificAllocBase::Instances)
20     Alloc->reset();
21   BAlloc.Reset();
22 }
23