OpenTTD Source  1.11.2
alloc_func.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #include "../stdafx.h"
11 
12 #include "../safeguards.h"
13 
18 void NORETURN MallocError(size_t size)
19 {
20  error("Out of memory. Cannot allocate " PRINTF_SIZE " bytes", size);
21 }
22 
27 void NORETURN ReallocError(size_t size)
28 {
29  error("Out of memory. Cannot reallocate " PRINTF_SIZE " bytes", size);
30 }
ReallocError
void NORETURN ReallocError(size_t size)
Function to exit with an error message after realloc() have failed.
Definition: alloc_func.cpp:27
error
void CDECL error(const char *s,...)
Error handling for fatal non-user errors.
Definition: openttd.cpp:132
MallocError
void NORETURN MallocError(size_t size)
Function to exit with an error message after malloc() or calloc() have failed.
Definition: alloc_func.cpp:18