15 #ifndef LLVM_SUPPORT_RECYCLINGALLOCATOR_H 16 #define LLVM_SUPPORT_RECYCLINGALLOCATOR_H 25 template <
class AllocatorType,
class T,
size_t Size =
sizeof(
T),
26 size_t Align =
alignof(T)>
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,
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,
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
This class represents lattice values for constants.
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)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
Recycler - This class manages a linked-list of deallocated nodes and facilitates reusing deallocated ...
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.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())