Fix: Don't try to rename OWNER_DEITY signs in-game (#9716)
[openttd-github.git] / src / core / alloc_func.cpp
blob86ba76623fa37c4a71ddcf644e89338320ff1d62
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 */
8 /** @file alloc_func.cpp Functions to 'handle' memory allocation errors */
10 #include "../stdafx.h"
12 #include "../safeguards.h"
14 /**
15 * Function to exit with an error message after malloc() or calloc() have failed
16 * @param size number of bytes we tried to allocate
18 void NORETURN MallocError(size_t size)
20 error("Out of memory. Cannot allocate " PRINTF_SIZE " bytes", size);
23 /**
24 * Function to exit with an error message after realloc() have failed
25 * @param size number of bytes we tried to allocate
27 void NORETURN ReallocError(size_t size)
29 error("Out of memory. Cannot reallocate " PRINTF_SIZE " bytes", size);