OpenTTD Source  20241108-master-g80f628063a
alloc_func.cpp File Reference

Functions to 'handle' memory allocation errors. More...

#include "../stdafx.h"
#include "../error_func.h"
#include "../safeguards.h"

Go to the source code of this file.

Functions

void MallocError (size_t size)
 Function to exit with an error message after malloc() or calloc() have failed. More...
 
void ReallocError (size_t size)
 Function to exit with an error message after realloc() have failed. More...
 

Detailed Description

Functions to 'handle' memory allocation errors.

Definition in file alloc_func.cpp.

Function Documentation

◆ MallocError()

void MallocError ( size_t  size)

Function to exit with an error message after malloc() or calloc() have failed.

Parameters
sizenumber of bytes we tried to allocate

Definition at line 20 of file alloc_func.cpp.

Referenced by ScriptAllocator::CheckAllocation(), and CheckAllocationConstraints().

◆ ReallocError()

void ReallocError ( size_t  size)

Function to exit with an error message after realloc() have failed.

Parameters
sizenumber of bytes we tried to allocate

Definition at line 29 of file alloc_func.cpp.