LLVM 22.0.0git
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 >:
[legend]

Public Member Functions

 ~Recycler ()
 Recycler (const Recycler &)=delete
 Recycler (Recycler &&Other)
 Recycler ()=default
template<class AllocatorType>
void clear (AllocatorType &Allocator)
 clear - Release all the tracked allocations to the allocator.
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 37 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 60 of file Recycler.h.

References assert().

◆ Recycler() [1/3]

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

References Recycler().

Referenced by Recycler(), and Recycler().

◆ Recycler() [2/3]

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

Definition at line 67 of file Recycler.h.

References llvm::Other, and Recycler().

◆ Recycler() [3/3]

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

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

Definition at line 90 of file Recycler.h.

References Allocator, and Size.

Referenced by Allocate().

◆ 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 102 of file Recycler.h.

References Allocate(), Allocator, and T.

◆ clear()

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 75 of file Recycler.h.

References Allocator, Size, and T.

◆ 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

Definition at line 107 of file Recycler.h.

◆ PrintStats()

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

Definition at line 115 of file Recycler.h.

References I, llvm::PrintRecyclerStats(), and Size.


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