15 #ifndef LLVM_SUPPORT_RECYCLINGALLOCATOR_H
16 #define LLVM_SUPPORT_RECYCLINGALLOCATOR_H
25 template<
class AllocatorType,
class T,
26 size_t Size =
sizeof(
T),
size_t Align = AlignOf<T>::Alignment>
35 AllocatorType Allocator;
43 template<
class SubClass>
44 SubClass *
Allocate() {
return Base.template Allocate<SubClass>(Allocator); }
51 template<
class SubClass>
55 Allocator.PrintStats();
62 template<
class AllocatorType,
class T,
size_t Size,
size_t Align>
63 inline void *
operator new(
size_t size,
65 T, Size,
Align> &Allocator) {
66 assert(
size <= Size &&
"allocation size exceeded");
67 return Allocator.Allocate();
70 template<
class AllocatorType,
class T,
size_t Size,
size_t Align>
71 inline void operator delete(
void *E,
void Deallocate(SubClass *E)
Deallocate - Release storage for the pointed-to object.
RecyclingAllocator - This class wraps an Allocator, adding the functionality of recycling deleted obj...
SubClass * Allocate(AllocatorType &Allocator)
Recycler - This class manages a linked-list of deallocated nodes and facilitates reusing deallocated ...
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(NoStrictAlign), cl::values(clEnumValN(StrictAlign,"aarch64-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"aarch64-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
SubClass * Allocate()
Allocate - Return a pointer to storage for an object of type SubClass.
void Deallocate(AllocatorType &, SubClass *Element)
void clear(AllocatorType &Allocator)
clear - Release all the tracked allocations to the allocator.