blob: 9bdcdcc8fdb28a81a2893fad06b38b86d131c161 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
//===- Memory.cpp -----------------------------------------------*- C++ -*-===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "lld/Support/Memory.h"
using namespace llvm;
namespace lld {
BumpPtrAllocator BAlloc;
StringSaver Saver{BAlloc};
SpecificAllocBase::SpecificAllocBase() { Instances.push_back(this); }
std::vector<SpecificAllocBase *> SpecificAllocBase::Instances;
void freeArena() {
for (SpecificAllocBase *Alloc : SpecificAllocBase::Instances)
Alloc->reset();
BAlloc.Reset();
}
}
|