LLVM  8.0.1
Classes | Namespaces | Typedefs | Functions
Allocator.h File Reference

This file defines the MallocAllocator and BumpPtrAllocator interfaces. More...

#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallVector.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::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

 llvm
 This class represents lattice values for constants.
 
 llvm::detail
 Implementation details of the pass manager interfaces.
 

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>
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

◆ operator delete()

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

Definition at line 514 of file Allocator.h.

◆ operator new()

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

Definition at line 497 of file Allocator.h.

References Allocator, D, llvm::ARM_MB::LD, llvm::NextPowerOf2(), offsetof, P, and Size.