LLVM  8.0.1
Classes | Public Member Functions | List of all members
llvm::Recycler< T, Size, Align > Class Template Reference

Recycler - This class manages a linked-list of deallocated nodes and facilitates reusing deallocated memory in place of allocating new memory. More...

#include "llvm/Support/Recycler.h"

Inheritance diagram for llvm::Recycler< T, Size, Align >:
Inheritance graph
[legend]

Public Member Functions

 ~Recycler ()
 
template<class AllocatorType >
void clear (AllocatorType &Allocator)
 clear - Release all the tracked allocations to the allocator. More...
 
void clear (BumpPtrAllocator &)
 Special case for BumpPtrAllocator which has an empty Deallocate() function. More...
 
template<class SubClass , class AllocatorType >
SubClass * Allocate (AllocatorType &Allocator)
 
template<class AllocatorType >
TAllocate (AllocatorType &Allocator)
 
template<class SubClass , class AllocatorType >
void Deallocate (AllocatorType &, SubClass *Element)
 
void PrintStats ()
 

Detailed Description

template<class T, size_t Size = sizeof(T), size_t Align = alignof(T)>
class llvm::Recycler< T, Size, Align >

Recycler - This class manages a linked-list of deallocated nodes and facilitates reusing deallocated memory in place of allocating new memory.

Definition at line 35 of file Recycler.h.

Constructor & Destructor Documentation

◆ ~Recycler()

template<class T, size_t Size = sizeof(T), size_t Align = alignof(T)>
llvm::Recycler< T, Size, Align >::~Recycler ( )
inline

Definition at line 58 of file Recycler.h.

Member Function Documentation

◆ Allocate() [1/2]

template<class T, size_t Size = sizeof(T), size_t Align = alignof(T)>
template<class SubClass , class AllocatorType >
SubClass* llvm::Recycler< T, Size, Align >::Allocate ( AllocatorType &  Allocator)
inline

◆ Allocate() [2/2]

template<class T, size_t Size = sizeof(T), size_t Align = alignof(T)>
template<class AllocatorType >
T* llvm::Recycler< T, Size, Align >::Allocate ( AllocatorType &  Allocator)
inline

Definition at line 94 of file Recycler.h.

◆ clear() [1/2]

template<class T, size_t Size = sizeof(T), size_t Align = alignof(T)>
template<class AllocatorType >
void llvm::Recycler< T, Size, Align >::clear ( AllocatorType &  Allocator)
inline

clear - Release all the tracked allocations to the allocator.

The recycler must be free of any tracked allocations before being deleted; calling clear is one way to ensure this.

Definition at line 69 of file Recycler.h.

Referenced by llvm::RecyclingAllocator< BumpPtrAllocator, SDNode, sizeof(LargestSDNode), alignof(MostAlignedSDNode)>::~RecyclingAllocator().

◆ clear() [2/2]

template<class T, size_t Size = sizeof(T), size_t Align = alignof(T)>
void llvm::Recycler< T, Size, Align >::clear ( BumpPtrAllocator )
inline

Special case for BumpPtrAllocator which has an empty Deallocate() function.

There is no need to traverse the free list, pulling all the objects into cache.

Definition at line 81 of file Recycler.h.

◆ Deallocate()

template<class T, size_t Size = sizeof(T), size_t Align = alignof(T)>
template<class SubClass , class AllocatorType >
void llvm::Recycler< T, Size, Align >::Deallocate ( AllocatorType &  ,
SubClass *  Element 
)
inline

◆ PrintStats()

template<class T , size_t Size, size_t Align>
void llvm::Recycler< T, Size, Align >::PrintStats ( )

The documentation for this class was generated from the following file: