MotorControlModuleSDFM_TMS3.../Projects/EFC_Application/UMLibrary/memories/BadStaticAlloc.hh

33 lines
775 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_ */