smatz@8537: /* $Id$ */ smatz@8537: rubidium@9111: /** @file alloc_func.cpp Functions to 'handle' memory allocation errors */ smatz@8537: smatz@8537: #include "../stdafx.h" smatz@8537: #include "alloc_func.hpp" smatz@8537: smatz@8537: /** smatz@8537: * Function to exit with an error message after malloc() or calloc() have failed smatz@8537: * @param size number of bytes we tried to allocate smatz@8537: */ smatz@8984: void NORETURN MallocError(size_t size) smatz@8537: { smatz@8537: error("Out of memory. Cannot allocate %i bytes", size); smatz@8537: } smatz@8537: smatz@8537: /** smatz@8537: * Function to exit with an error message after realloc() have failed smatz@8537: * @param size number of bytes we tried to allocate smatz@8537: */ smatz@8984: void NORETURN ReallocError(size_t size) smatz@8537: { smatz@8537: error("Out of memory. Cannot reallocate %i bytes", size); smatz@8537: }