LLVM 20.0.0git
Classes | Namespaces | Typedefs | Functions
Allocator.h File Reference

This file defines the BumpPtrAllocator interface. More...

#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/AllocatorBase.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/MathExtras.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <optional>
#include <utility>

Go to the source code of this file.

Classes

class  llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold, GrowthDelay >
 Allocate memory in an ever growing pool, as if by bump-pointer. More...
 
class  llvm::SpecificBumpPtrAllocator< T >
 A BumpPtrAllocator that allows only elements of a specific type to be allocated. More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::detail
 These are wrappers over isa* function that allow them to be used in generic algorithms such as llvm:all_of, llvm::none_of, etc.
 

Typedefs

typedef BumpPtrAllocatorImpl llvm::BumpPtrAllocator
 The standard BumpPtrAllocator which just uses the default template parameters.
 

Functions

void llvm::detail::printBumpPtrAllocatorStats (unsigned NumSlabs, size_t BytesAllocated, size_t TotalMemory)
 
template<typename AllocatorT , size_t SlabSize, size_t SizeThreshold, size_t GrowthDelay>
void * operator new (size_t Size, llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold, GrowthDelay > &Allocator)
 
template<typename AllocatorT , size_t SlabSize, size_t SizeThreshold, size_t GrowthDelay>
void operator delete (void *, llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold, GrowthDelay > &)
 

Detailed Description

This file defines the BumpPtrAllocator interface.

BumpPtrAllocator conforms to the LLVM "Allocator" concept and is similar to MallocAllocator, but objects cannot be deallocated. Their lifetime is tied to the lifetime of the allocator.

Definition in file Allocator.h.

Function Documentation

◆ operator delete()

template<typename AllocatorT , size_t SlabSize, size_t SizeThreshold, size_t GrowthDelay>
void operator delete ( void *  ,
llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold, GrowthDelay > &   
)

Definition at line 463 of file Allocator.h.

◆ operator new()

template<typename AllocatorT , size_t SlabSize, size_t SizeThreshold, size_t GrowthDelay>
void * operator new ( size_t  Size,
llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold, GrowthDelay > &  Allocator 
)

Definition at line 454 of file Allocator.h.

References Allocator, llvm::NextPowerOf2(), and Size.