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