mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-15 23:29:42 +00:00
8446d6b8c2
- Fix: Wrong number of parameters or wrong parameter types sent to printf-like functions at several places (r16269) - Fix: [NewGRF] When callback 2E returns an amount of 0, do not transport 1 unit to the station (r16268) - Fix: [NoAI] Various documentation omissions with respect to IDs of various objects and corners for AITile::(Raise|Lower)Tile (r16267,r16266)
25 lines
639 B
C++
25 lines
639 B
C++
/* $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 " PRINTF_SIZE " 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 " PRINTF_SIZE " bytes", size);
|
|
}
|