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