Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
Bond::Allocator::AlignedDeallocator< T > Struct Template Reference

A custom unique_ptr deleter that deallocates aligned memory by calling Allocator::FreeAligned, rather than the delete operator. The memory is only freed; no object destruction is performed. More...

#include <bond/systems/allocator.h>

Public Member Functions

 AlignedDeallocator (Allocator *allocator=nullptr)
 Constructs an AlignedDeallocator object.
void operator() (T *ptr)
 Frees the given memory by calling Allocator::FreeAligned.

Public Attributes

Allocator * mAllocator
 The allocator that frees the memory.

Detailed Description

template<typename T>
struct Bond::Allocator::AlignedDeallocator< T >

A custom unique_ptr deleter that deallocates aligned memory by calling Allocator::FreeAligned, rather than the delete operator. The memory is only freed; no object destruction is performed.

Constructor & Destructor Documentation

◆ AlignedDeallocator()

template<typename T>
Bond::Allocator::AlignedDeallocator< T >::AlignedDeallocator ( Allocator * allocator = nullptr)
inlineexplicit

Constructs an AlignedDeallocator object.

Parameters
allocatorThe allocator that frees the memory. If null, the memory is not freed.

Member Function Documentation

◆ operator()()

template<typename T>
void Bond::Allocator::AlignedDeallocator< T >::operator() ( T * ptr)
inline

Frees the given memory by calling Allocator::FreeAligned.

Member Data Documentation

◆ mAllocator

template<typename T>
Allocator* Bond::Allocator::AlignedDeallocator< T >::mAllocator

The allocator that frees the memory.


The documentation for this struct was generated from the following file:
  • include/bond/systems/allocator.h