LLVM API Documentation

Classes | Namespaces | Typedefs | Functions
Allocator.h File Reference
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/AlignOf.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Memory.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdlib>
Include dependency graph for Allocator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  llvm::AllocatorBase< DerivedT >
 CRTP base class providing obvious overloads for the core Allocate() methods of LLVM-style allocators. More...
class  llvm::MallocAllocator
class  llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold >
 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
 

List of target independent CodeGen pass IDs.


namespace  llvm::detail
 

Implementation details of the pass manager interfaces.


Typedefs

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

Functions

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

Detailed Description

This file defines the MallocAllocator and BumpPtrAllocator interfaces. Both of these conform to an LLVM "Allocator" concept which consists of an Allocate method accepting a size and alignment, and a Deallocate accepting a pointer and size. Further, the LLVM "Allocator" concept has overloads of Allocate and Deallocate for setting size and alignment based on the final type. These overloads are typically provided by a base class template AllocatorBase.

Definition in file Allocator.h.


Function Documentation

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

Definition at line 425 of file Allocator.h.

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

Definition at line 408 of file Allocator.h.

References llvm::A64DB::LD, llvm::NextPowerOf2(), and P.