src/core/alloc_func.cpp
author richk
Sun, 20 Apr 2008 15:27:28 +0000
branchNewGRF_ports
changeset 10274 b3c58f3df92b
parent 6878 7d1ff2f621c7
child 10429 1b99254f9607
permissions -rw-r--r--
(svn r12806) [NewGRF_ports] -Sync: with trunk r12773:12805.
/* $Id$ */

/** @file alloc_func.cpp functions to 'handle' memory allocation errors */

#include "../stdafx.h"
#include "alloc_func.hpp"

/**
 * Function to exit with an error message after malloc() or calloc() have failed
 * @param size number of bytes we tried to allocate
 */
void NORETURN MallocError(size_t size)
{
	error("Out of memory. Cannot allocate %i bytes", size);
}

/**
 * Function to exit with an error message after realloc() have failed
 * @param size number of bytes we tried to allocate
 */
void NORETURN ReallocError(size_t size)
{
	error("Out of memory. Cannot reallocate %i bytes", size);
}