class Recycler

Declaration

template <class T,
          size_t Size = sizeof(type - parameter - 0 - 0),
          size_t Align = alignof(type - parameter - 0 - 0)>
class Recycler { /* full declaration omitted */ };

Description

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

Declared at: llvm/include/llvm/Support/Recycler.h:34

Templates

T
size_t Size = sizeof(type-parameter-0-0)
size_t Align = alignof(type-parameter-0-0)

Member Variables

private llvm::Recycler::FreeNode* FreeList = nullptr
List of nodes that have deleted contents and are not in active use.

Method Overview

  • public template <class SubClass, class AllocatorType>SubClass * Allocate(AllocatorType & Allocator)
  • public template <class AllocatorType>T * Allocate(AllocatorType & Allocator)
  • public template <class SubClass, class AllocatorType>void Deallocate(AllocatorType &, SubClass * Element)
  • public void PrintStats()
  • public void clear(llvm::BumpPtrAllocator &)
  • public template <class AllocatorType>void clear(AllocatorType & Allocator)
  • private llvm::Recycler::FreeNode * pop_val()
  • private void push(llvm::Recycler::FreeNode * N)
  • public ~Recycler<T, Size, Align>()

Methods

template <class SubClass, class AllocatorType>
SubClass* Allocate(AllocatorType& Allocator)

Declared at: llvm/include/llvm/Support/Recycler.h:83

Templates

SubClass
AllocatorType

Parameters

AllocatorType& Allocator

template <class AllocatorType>
T* Allocate(AllocatorType& Allocator)

Declared at: llvm/include/llvm/Support/Recycler.h:93

Templates

AllocatorType

Parameters

AllocatorType& Allocator

template <class SubClass, class AllocatorType>
void Deallocate(AllocatorType&, SubClass* Element)

Declared at: llvm/include/llvm/Support/Recycler.h:98

Templates

SubClass
AllocatorType

Parameters

AllocatorType&
SubClass* Element

void PrintStats()

Declared at: llvm/include/llvm/Support/Recycler.h:102

void clear(llvm::BumpPtrAllocator&)

Description

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.

Declared at: llvm/include/llvm/Support/Recycler.h:80

Parameters

llvm::BumpPtrAllocator&

template <class AllocatorType>
void clear(AllocatorType& Allocator)

Description

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.

Declared at: llvm/include/llvm/Support/Recycler.h:68

Templates

AllocatorType

Parameters

AllocatorType& Allocator

llvm::Recycler::FreeNode* pop_val()

Declared at: llvm/include/llvm/Support/Recycler.h:42

void push(llvm::Recycler::FreeNode* N)

Declared at: llvm/include/llvm/Support/Recycler.h:50

Parameters

llvm::Recycler::FreeNode* N

~Recycler<T, Size, Align>()

Declared at: llvm/include/llvm/Support/Recycler.h:57