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