OpenTTD Source: src/core/alloc_func.cpp File Reference

OpenTTD Source 1.11.0-RC1

Functions
alloc_func.cpp File Reference
`#include "../stdafx.h"`
`#include "../safeguards.h"`

Go to the source code of this file.

## Functions
void NORETURN | MallocError (size_t size)
| Function to exit with an error message after malloc() or calloc() have failed. More...
void NORETURN | 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 NORETURN MallocError | ( | size_t | size | ) |

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

Parameters

  size | number of bytes we tried to allocate

Definition at line 18 of file alloc_func.cpp.

References error().

## ◆ ReallocError()

void NORETURN ReallocError | ( | size_t | size | ) |

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

Parameters

  size | number of bytes we tried to allocate

Definition at line 27 of file alloc_func.cpp.

References error().