Go to the documentation of this file.
9 #ifndef EAGINE_MEMORY_NULL_ALLOC_HPP
10 #define EAGINE_MEMORY_NULL_ALLOC_HPP
12 #include "../assert.hpp"
15 namespace eagine::memory {
17 template <
typename Policy = default_
byte_allocator_policy>
18 class null_byte_allocator
19 :
public byte_allocator_impl<Policy, null_byte_allocator> {
23 auto equal(byte_allocator* a)
const noexcept ->
bool override {
24 return dynamic_cast<null_byte_allocator*
>(a) !=
nullptr;
27 auto max_size(size_type) noexcept -> size_type
override {
31 auto has_allocated(
const owned_block&, size_type) noexcept
36 auto allocate(size_type, size_type) noexcept -> owned_block
override {
40 void deallocate(owned_block&& b, size_type) noexcept
override {
41 EAGINE_ASSERT(b.empty());
47 #endif // EAGINE_MEMORY_NULL_ALLOC_HPP
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
constexpr static const indeterminate_t indeterminate
Constant representing unspecified tribool value.
Definition: tribool.hpp:24