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

A custom unique_ptr deleter that destroys an aligned object by calling its destructor then freeing its memory by calling Allocator::FreeAligned rather than the delete operator. More...

#include <bond/systems/allocator.h>

Public Member Functions

 AlignedObjectDeallocator (Allocator *allocator=nullptr)
 Constructs an AlignedObjectDeallocator object.
void operator() (T *ptr)
 Destroys the given object and frees its memory by calling Allocator::FreeAligned.

Public Attributes

Allocator * mAllocator
 The allocator that frees the memory.

Detailed Description

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

A custom unique_ptr deleter that destroys an aligned object by calling its destructor then freeing its memory by calling Allocator::FreeAligned rather than the delete operator.

Constructor & Destructor Documentation

◆ AlignedObjectDeallocator()

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

Constructs an AlignedObjectDeallocator object.

Parameters
allocatorThe allocator that frees the memory. If null, the object is neither destroyed nor freed.

Member Function Documentation

◆ operator()()

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

Destroys the given object and frees its memory by calling Allocator::FreeAligned.

Member Data Documentation

◆ mAllocator

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

The allocator that frees the memory.


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