7#ifndef WPI_MEMORY_ERROR_HPP_INCLUDED
8#define WPI_MEMORY_ERROR_HPP_INCLUDED
48 return a.allocator == b.allocator;
54 return a.allocator != b.allocator;
95 const char*
what() const noexcept override;
131 const char*
what() const noexcept override;
161 std::size_t supported);
175 std::size_t supported);
179 const char*
what() const noexcept override;
203 std::size_t passed_, supported_;
221 const char*
what() const noexcept override;
239 const char*
what() const noexcept override;
258 const char*
what() const noexcept override;
263 template <
class Ex,
typename Func>
266#if WPI_MEMORY_CHECK_ALLOCATION_SIZE
267 auto supported = f();
268 if (passed > supported)
281 check_allocation_size<Ex>(
282 passed, [&] {
return supported; }, info);
The exception class thrown when the alignment exceeds the supported maximum, i.e.
Definition error.hpp:247
bad_alignment(const allocator_info &info, std::size_t passed, std::size_t supported)
Definition error.hpp:251
const char * what() const noexcept override
The exception class thrown when an allocation size is bigger than the supported maximum.
Definition error.hpp:147
std::size_t passed_value() const noexcept
Definition error.hpp:189
bad_allocation_size(const allocator_info &info, std::size_t passed, std::size_t supported)
static handler get_handler()
static handler set_handler(handler h)
void(*)(const allocator_info &info, std::size_t passed, std::size_t supported) handler
The type of the handler called in the constructor of bad_allocation_size.
Definition error.hpp:160
const char * what() const noexcept override
std::size_t supported_value() const noexcept
Definition error.hpp:196
The exception class thrown when the array size exceeds the supported maximum, i.e.
Definition error.hpp:229
bad_array_size(const allocator_info &info, std::size_t passed, std::size_t supported)
Definition error.hpp:232
const char * what() const noexcept override
The exception class thrown when the node size exceeds the supported maximum, i.e.
Definition error.hpp:211
bad_node_size(const allocator_info &info, std::size_t passed, std::size_t supported)
Definition error.hpp:214
const char * what() const noexcept override
A special case of out_of_memory errors thrown when a low-level allocator with a fixed size runs out o...
Definition error.hpp:121
out_of_fixed_memory(const allocator_info &info, std::size_t amount)
Definition error.hpp:124
const char * what() const noexcept override
The exception class thrown when a low level allocator runs out of memory.
Definition error.hpp:65
const char * what() const noexcept override
static handler set_handler(handler h)
static handler get_handler()
void(*)(const allocator_info &info, std::size_t amount) handler
The type of the handler called in the constructor of out_of_memory.
Definition error.hpp:79
std::size_t failed_allocation_size() const noexcept
Definition error.hpp:105
const allocator_info & allocator() const noexcept
Definition error.hpp:98
out_of_memory(const allocator_info &info, std::size_t amount)
#define WPI_THROW(Ex)
Definition config.hpp:33
detail namespace with internal helper functions
Definition input_adapters.h:32
Implement std::hash so that hash_code can be used in STL containers.
Definition PointerIntPair.h:280
void check_allocation_size(std::size_t passed, Func f, const allocator_info &info)
Definition error.hpp:264
Memory namespace.
Definition heap_allocator.hpp:20
Foonathan namespace.
Definition ntcore_cpp.h:26
Contains information about an allocator.
Definition error.hpp:23
const void * allocator
A pointer representing an allocator.
Definition error.hpp:34
friend constexpr bool operator==(const allocator_info &a, const allocator_info &b) noexcept
Definition error.hpp:45
friend constexpr bool operator!=(const allocator_info &a, const allocator_info &b) noexcept
Definition error.hpp:51
constexpr allocator_info(const char *n, const void *alloc) noexcept
Definition error.hpp:37
const char * name
The name of the allocator.
Definition error.hpp:27