|
Gamp v0.0.7-36-g24b1eb6
Gamp: Graphics, Audio, Multimedia and Processing
|
A simple allocator using POSIX C functions: ::malloc(), ::free() and ::realloc().
More...
#include <callocator.hpp>
Classes | |
| struct | rebind |
Public Types | |
| typedef const T * | const_pointer |
| typedef const T & | const_reference |
| typedef std::ptrdiff_t | difference_type |
| typedef std::true_type | is_always_equal |
| typedef T * | pointer |
| typedef std::true_type | propagate_on_container_move_assignment |
| typedef T & | reference |
| typedef std::size_t | size_type |
| typedef T | value_type |
Public Member Functions | |
| callocator () noexcept=default | |
| callocator (const callocator &) noexcept | |
| template<typename U> | |
| callocator (const callocator< U > &) noexcept | |
| ~callocator ()=default | |
| value_type * | allocate (std::size_t n) |
| value_type * | allocate (std::size_t n, const void *) |
| void | deallocate (value_type *p, std::size_t) noexcept |
| constexpr value_type * | reallocate (value_type *p, std::size_t, std::size_t new_size) |
A simple allocator using POSIX C functions: ::malloc(), ::free() and ::realloc().
It is the missing ::realloc() in std::allocator, motivating this class.
Since realloc() requires the passed pointer to originate from malloc() or calloc, we have to use it for allocate() as well.
Added method is reallocate() using the native realloc().
This class shall be compliant with C++ named requirements for Allocator.
Not implementing deprecated (C++17) and removed (C++20) methods: address(), max_size(), construct() and destroy().
Definition at line 49 of file callocator.hpp.
| typedef T jau::callocator< T >::value_type |
Definition at line 53 of file callocator.hpp.
| typedef std::size_t jau::callocator< T >::size_type |
Definition at line 54 of file callocator.hpp.
| typedef std::ptrdiff_t jau::callocator< T >::difference_type |
Definition at line 55 of file callocator.hpp.
| typedef std::true_type jau::callocator< T >::propagate_on_container_move_assignment |
Definition at line 56 of file callocator.hpp.
| typedef std::true_type jau::callocator< T >::is_always_equal |
Definition at line 59 of file callocator.hpp.
| typedef T* jau::callocator< T >::pointer |
Definition at line 62 of file callocator.hpp.
| typedef const T* jau::callocator< T >::const_pointer |
Definition at line 63 of file callocator.hpp.
| typedef T& jau::callocator< T >::reference |
Definition at line 64 of file callocator.hpp.
| typedef const T& jau::callocator< T >::const_reference |
Definition at line 65 of file callocator.hpp.
|
defaultnoexcept |
|
inlinenoexcept |
Definition at line 81 of file callocator.hpp.
|
inlinenoexcept |
Definition at line 91 of file callocator.hpp.
|
default |
|
inline |
|
inline |
Definition at line 112 of file callocator.hpp.
|
inlinenodiscardconstexpr |
|
inlinenoexcept |