KTL
ktl::mallocator Class Reference

An allocator which uses an aligned malloc for allocation. More...

#include <mallocator.h>

Public Member Functions

 mallocator () noexcept=default
 
 mallocator (const mallocator &) noexcept=default
 
 mallocator (mallocator &&) noexcept=default
 
mallocatoroperator= (const mallocator &) noexcept=default
 
mallocatoroperator= (mallocator &&) noexcept=default
 
bool operator== (const mallocator &rhs) const noexcept
 
bool operator!= (const mallocator &rhs) const noexcept
 
void * allocate (size_t n) noexcept
 
void deallocate (void *p, size_t n) noexcept
 

Detailed Description

An allocator which uses an aligned malloc for allocation.

Note
Like std::allocator it holds no state, so any instance can de/allocate mememory from any other instance. Similar to std::allocator, except it's untyped.

Constructor & Destructor Documentation

◆ mallocator() [1/3]

ktl::mallocator::mallocator ( )
defaultnoexcept

◆ mallocator() [2/3]

ktl::mallocator::mallocator ( const mallocator )
defaultnoexcept

◆ mallocator() [3/3]

ktl::mallocator::mallocator ( mallocator &&  )
defaultnoexcept

Member Function Documentation

◆ allocate()

void* ktl::mallocator::allocate ( size_t  n)
inlinenoexcept

◆ deallocate()

void ktl::mallocator::deallocate ( void *  p,
size_t  n 
)
inlinenoexcept

◆ operator!=()

bool ktl::mallocator::operator!= ( const mallocator rhs) const
inlinenoexcept

◆ operator=() [1/2]

mallocator& ktl::mallocator::operator= ( const mallocator )
defaultnoexcept

◆ operator=() [2/2]

mallocator& ktl::mallocator::operator= ( mallocator &&  )
defaultnoexcept

◆ operator==()

bool ktl::mallocator::operator== ( const mallocator rhs) const
inlinenoexcept

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