OpenTTD
Public Member Functions
ZeroedMemoryAllocator Class Reference

Base class that provides memory initialization on dynamically created objects. More...

#include <alloc_type.hpp>

Inheritance diagram for ZeroedMemoryAllocator:
ClientNetworkGameSocketHandler GRFConfig GRFError GRFFile NewGRFSpriteLayout NWidgetBase UnmappedChoiceList Window WindowDesc

Public Member Functions

void * operator new (size_t size)
 Memory allocator for a single class instance.
void * operator new[] (size_t size)
 Memory allocator for an array of class instances.
void operator delete (void *ptr)
 Memory release for a single class instance.
void operator delete[] (void *ptr)
 Memory release for an array of class instances.

Detailed Description

Base class that provides memory initialization on dynamically created objects.

All allocated memory will be zeroed.

Definition at line 150 of file alloc_type.hpp.

Member Function Documentation

void ZeroedMemoryAllocator::operator delete ( void *  ptr)
inline

Memory release for a single class instance.

Parameters
ptrthe memory to free.

Reimplemented in Window.

Definition at line 174 of file alloc_type.hpp.

References free().

void ZeroedMemoryAllocator::operator delete[] ( void *  ptr)
inline

Memory release for an array of class instances.

Parameters
ptrthe memory to free.

Definition at line 180 of file alloc_type.hpp.

References free().

void* ZeroedMemoryAllocator::operator new ( size_t  size)
inline

Memory allocator for a single class instance.

Parameters
sizethe amount of bytes to allocate.
Returns
the given amounts of bytes zeroed.

Definition at line 161 of file alloc_type.hpp.

void* ZeroedMemoryAllocator::operator new[] ( size_t  size)
inline

Memory allocator for an array of class instances.

Parameters
sizethe amount of bytes to allocate.
Returns
the given amounts of bytes zeroed.

Reimplemented in Window.

Definition at line 168 of file alloc_type.hpp.


The documentation for this class was generated from the following file: