MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/memories/BadStaticAlloc.hh
2024-06-07 11:12:56 +03:00

33 lines
779 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 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_ */