17 #ifndef CHECKED_ALLOC_H
18 #define CHECKED_ALLOC_H
20 #define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED 1
28 #include "../Logger/Logger.h"
29 #include "../Shared/types.h"
35 VLOG(1) <<
"Failed to allocate " << size <<
" bytes\n"
36 << boost::stacktrace::stacktrace();
46 auto ptr = malloc(size);
54 auto ptr = calloc(nmemb, size);
65 #endif // CHECKED_ALLOC_H
const std::string what_str_
void * checked_malloc(const size_t size)
void * checked_calloc(const size_t nmemb, const size_t size)
const char * what() const noexceptfinal
OutOfHostMemory(const size_t size)