Direct-BT
2.3.1
Direct-BT - Direct Bluetooth Programming.
|
A simple allocator using POSIX C functions: ::malloc()
, ::free()
and ::realloc()
.
More...
#include <callocator.hpp>
Classes | |
struct | rebind |
Public Types | |
typedef T | value_type |
Public Member Functions | |
callocator () noexcept | |
callocator (const callocator &other) noexcept | |
template<typename U > | |
callocator (const callocator< U > &other) noexcept | |
~callocator () | |
value_type * | allocate (std::size_t n, const void *hint) |
value_type * | allocate (std::size_t n) |
constexpr value_type * | reallocate (value_type *p, std::size_t old_size, std::size_t new_size) |
void | deallocate (value_type *p, std::size_t n) |
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 52 of file callocator.hpp.
typedef T jau::callocator< T >::value_type |
Definition at line 58 of file callocator.hpp.
|
inlinenoexcept |
Definition at line 61 of file callocator.hpp.
|
inlinenoexcept |
Definition at line 68 of file callocator.hpp.
|
inlinenoexcept |
Definition at line 78 of file callocator.hpp.
|
inline |
Definition at line 85 of file callocator.hpp.
|
inline |
Definition at line 100 of file callocator.hpp.
|
inline |
|
inline |
|
inlineconstexpr |