LLVM  14.0.0git
Classes | Namespaces | Typedefs | Functions
Allocator.h File Reference
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/AllocatorBase.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemAlloc.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <iterator>
#include <type_traits>
#include <utility>
Include dependency graph for Allocator.h:

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

 llvm
 ---------------------— PointerInfo ------------------------------------—
 
 llvm::detail
 

Typedefs

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

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 443 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 434 of file Allocator.h.

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