nngn
Loading...
Searching...
No Matches
nngn::reallocator< T > Struct Template Reference

Simple allocator which supports reallocation. More...

#include <realloc.h>

Inheritance diagram for nngn::reallocator< T >:
Collaboration diagram for nngn::reallocator< T >:

Public Types

using value_type = T
 
using pointer = std::add_pointer_t<value_type>
 

Public Member Functions

pointer allocate (std::size_t n) noexcept
 
pointer reallocate (pointer p, std::size_t n) noexcept
 
void deallocate (pointer p, std::size_t) noexcept
 

Detailed Description

template<trivial T = char>
struct nngn::reallocator< T >

Simple allocator which supports reallocation.

Implemented in terms of malloc(3), realloc(3), and free(3) (which is why T must be nngn::trivial). Can be nested in other allocators that provide an optional reallocate method.

Member Typedef Documentation

◆ pointer

template<trivial T = char>
using nngn::reallocator< T >::pointer = std::add_pointer_t<value_type>

◆ value_type

template<trivial T = char>
using nngn::reallocator< T >::value_type = T

Member Function Documentation

◆ allocate()

template<trivial T>
auto nngn::reallocator< T >::allocate ( std::size_t n)
noexcept
Here is the caller graph for this function:

◆ deallocate()

template<trivial T = char>
void nngn::reallocator< T >::deallocate ( pointer p,
std::size_t  )
inlinenoexcept

◆ reallocate()

template<trivial T>
auto nngn::reallocator< T >::reallocate ( pointer p,
std::size_t n )
noexcept

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