33 lines
779 B
C++
33 lines
779 B
C++
/*
|
||
* BadStaticAlloc.hh
|
||
*
|
||
* Created on: 16 мар. 2020 г.
|
||
* Author: titov
|
||
*/
|
||
|
||
#ifndef UMLIBRARY_SYSTEMIC_BADSTATICALLOC_HH_
|
||
#define UMLIBRARY_SYSTEMIC_BADSTATICALLOC_HH_
|
||
|
||
#include <cstddef>
|
||
#include <new>
|
||
|
||
namespace memories {
|
||
|
||
struct BadStaticAlloc : public std::bad_alloc {
|
||
char * begin;
|
||
char * end;
|
||
void * location;
|
||
std::size_t object_num;
|
||
std::size_t size;
|
||
std::size_t aligment;
|
||
|
||
BadStaticAlloc(char * begin, char * end, void * location, std::size_t num, std::size_t size, std::size_t aligment ) :
|
||
begin(begin), end(end), location(location), object_num(num), size(size), aligment(aligment) {}
|
||
|
||
const char * what() const noexcept { return "bad static allocation"; }
|
||
};
|
||
|
||
}
|
||
|
||
#endif /* UMLIBRARY_SYSTEMIC_BADSTATICALLOC_HH_ */
|