55 #ifndef LIB_ALLOCATOR_HANDLE_H 56 #define LIB_ALLOCATOR_HANDLE_H 86 std::byte buf_[
sizeof(TY)];
88 template<
typename...ARGS>
90 create (ARGS&& ...args)
92 return *
new(&buf_) TY {std::forward<ARGS> (args)...};
98 return * std::launder (reinterpret_cast<TY*> (&buf_));
107 std::list<Allocation> storage_;
110 template<
typename...ARGS>
112 operator() (ARGS&& ...args)
114 auto pos = storage_.emplace (storage_.end());
116 return pos->create (std::forward<ARGS> (args)...);
120 storage_.erase (pos);
123 ERROR (memory,
"Allocation failed with unknown exception. " 124 "Lumiera errorID=%s", errID?errID:
"??");
134 for (
auto& alloc : storage_)
#define ERROR_LOG_AND_IGNORE(_FLAG_, _OP_DESCR_)
convenience shortcut for a sequence of catch blocks just logging and consuming an error...
Implementation namespace for support and library code.
Placeholder implementation for a custom allocator.
lumiera_err lumiera_error(void)
Get and clear current error state.
Lumiera error handling (C++ interface).