WPILibC++ 2024.3.2
wpi::AllocatorBase< DerivedT > Class Template Reference

CRTP base class providing obvious overloads for the core Allocate() methods of LLVM-style allocators. More...

#include </home/runner/work/allwpilib/allwpilib/wpiutil/src/main/native/thirdparty/llvm/include/wpi/AllocatorBase.h>

Public Member Functions

void * Allocate (size_t Size, size_t Alignment)
 Allocate Size bytes of Alignment aligned memory. More...
 
void Deallocate (const void *Ptr, size_t Size, size_t Alignment)
 Deallocate Ptr to Size bytes of memory allocated by this allocator. More...
 
template<typename T >
T * Allocate (size_t Num=1)
 Allocate space for a sequence of objects without constructing them. More...
 
template<typename T >
std::enable_if_t<!std::is_same_v< std::remove_cv_t< T >, void >, void > Deallocate (T *Ptr, size_t Num=1)
 Deallocate space for a sequence of objects without constructing them. More...
 

Detailed Description

template<typename DerivedT>
class wpi::AllocatorBase< DerivedT >

CRTP base class providing obvious overloads for the core 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.

Member Function Documentation

◆ Allocate() [1/2]

template<typename DerivedT >
template<typename T >
T * wpi::AllocatorBase< DerivedT >::Allocate ( size_t  Num = 1)
inline

Allocate space for a sequence of objects without constructing them.

◆ Allocate() [2/2]

template<typename DerivedT >
void * wpi::AllocatorBase< DerivedT >::Allocate ( size_t  Size,
size_t  Alignment 
)
inline

Allocate Size bytes of Alignment aligned memory.

This method must be implemented by DerivedT.

◆ Deallocate() [1/2]

template<typename DerivedT >
void wpi::AllocatorBase< DerivedT >::Deallocate ( const void *  Ptr,
size_t  Size,
size_t  Alignment 
)
inline

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

◆ Deallocate() [2/2]

template<typename DerivedT >
template<typename T >
std::enable_if_t<!std::is_same_v< std::remove_cv_t< T >, void >, void > wpi::AllocatorBase< DerivedT >::Deallocate ( T *  Ptr,
size_t  Num = 1 
)
inline

Deallocate space for a sequence of objects without constructing them.


The documentation for this class was generated from the following file: