class AllocatorBase

Declaration

template <typename DerivedT>
class AllocatorBase { /* full declaration omitted */ };

Description

CRTP base class providing obvious overloads for the core \c Allocate() methods of LLVM-style allocators. This base class both documents the full public interface exposed by all LLVM-style allocators, and redirects all of the overloads to a single core set of methods which the derived class must define.

Declared at: llvm/include/llvm/Support/Allocator.h:47

Templates

DerivedT

Method Overview

  • public void * Allocate(size_t Size, size_t Alignment)
  • public template <typename T>T * Allocate(size_t Num = 1)
  • public void Deallocate(const void * Ptr, size_t Size)
  • public template <typename T>typename std::enable_if<!std::is_same<typename std::remove_cv<T>::type, void>::value, void>::type Deallocate(T * Ptr, size_t Num = 1)

Methods

void* Allocate(size_t Size, size_t Alignment)

Description

Allocate \a Size bytes of \a Alignment aligned memory. This method must be implemented by \c DerivedT.

Declared at: llvm/include/llvm/Support/Allocator.h:51

Parameters

size_t Size
size_t Alignment

template <typename T>
T* Allocate(size_t Num = 1)

Description

Allocate space for a sequence of objects without constructing them.

Declared at: llvm/include/llvm/Support/Allocator.h:81

Templates

T

Parameters

size_t Num = 1

void Deallocate(const void* Ptr, size_t Size)

Description

Deallocate \a Ptr to \a Size bytes of memory allocated by this allocator.

Declared at: llvm/include/llvm/Support/Allocator.h:65

Parameters

const void* Ptr
size_t Size

template <typename T>
typename std::enable_if<
    !std::is_same<
        typename std::remove_cv<T>::type,
        void>::value,
    void>::type
Deallocate(T* Ptr, size_t Num = 1)

Description

Deallocate space for a sequence of objects without constructing them.

Declared at: llvm/include/llvm/Support/Allocator.h:89

Templates

T

Parameters

T* Ptr
size_t Num = 1