OpenTTD Source 20250205-master-gfd85ab1e2c
ZeroedMemoryAllocator Class Reference

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

#include <alloc_type.hpp>

Inheritance diagram for ZeroedMemoryAllocator:
GRFFile NWidgetBase NewGRFSpriteLayout OpenGLBackend Window NWidgetContainer NWidgetNewGRFDisplay NWidgetResizeBase AIConfigWindow AboutWindow BaseGraphWindow BaseNetworkContentDownloadStatusWindow BaseVehicleListWindow BootstrapAskForDownloadWindow BootstrapBackground BootstrapErrorWindow BuildAirToolbarWindow BuildBridgeWindow BuildDocksToolbarWindow BuildIndustryWindow BuildRailToolbarWindow BuildRoadToolbarWindow BuildTreesWindow BuildVehicleWindow BuyCompanyWindow CheatWindow CompanyFinancesWindow CompanyInfrastructureWindow CompanyStationsWindow CompanyWindow CreateScenarioWindow CustomCurrencyWindow DepotWindow DropdownWindow EndGameHighScoreBaseWindow EnginePreviewWindow ErrmsgWindow ExtraViewportWindow FoundTownWindow FramerateWindow FrametimeGraphWindow GSConfigWindow GameOptionsWindow GameSettingsWindow GenerateLandscapeWindow GenerateProgressWindow GoalListWindow GoalQuestionWindow GraphLegendWindow HelpWindow IConsoleWindow IndustryCargoesWindow IndustryDirectoryWindow IndustryViewWindow LandInfoWindow LinkGraphLegendWindow MainToolbarWindow MainWindow MessageHistoryWindow MusicTrackSelectionWindow MusicWindow NetworkAskRelayWindow NetworkAskSurveyWindow NetworkChatWindow NetworkClientListWindow NetworkContentListWindow NetworkGameWindow NetworkJoinStatusWindow NetworkStartServerWindow NewGRFInspectWindow NewGRFParametersWindow NewGRFWindow NewsWindow OrdersWindow OskWindow PerformanceLeagueWindow PerformanceRatingDetailWindow PickerWindowBase QueryStringWindow QueryWindow RefitWindow ReplaceVehicleWindow SaveLoadWindow SavePresetWindow ScanProgressWindow ScenarioEditorLandscapeGenerationWindow ScenarioEditorToolbarWindow ScreenshotWindow ScriptDebugWindow ScriptLeagueWindow ScriptListWindow ScriptSettingsWindow SelectCompanyLiveryWindow SelectCompanyManagerFaceWindow SelectGameWindow SelectStationWindow< T > SetDateWindow SignListWindow SignWindow SmallMapWindow SpriteAlignerWindow StationViewWindow StatusBarWindow StoryBookWindow SubsidyListWindow TerraformToolbarWindow TextfileWindow TimetableWindow TooltipsWindow TownAuthorityWindow TownDirectoryWindow TownViewWindow TransparenciesWindow VehicleDetailsWindow VehicleViewWindow WaypointWindow

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 85 of file alloc_type.hpp.

Constructor & Destructor Documentation

◆ ZeroedMemoryAllocator()

ZeroedMemoryAllocator::ZeroedMemoryAllocator ( )
inline

Definition at line 88 of file alloc_type.hpp.

Member Function Documentation

◆ operator delete()

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

Memory release for a single class instance.

Parameters
ptrthe memory to free.

Definition at line 109 of file alloc_type.hpp.

References free().

◆ operator delete[]()

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

Memory release for an array of class instances.

Parameters
ptrthe memory to free.

Definition at line 115 of file alloc_type.hpp.

References free().

◆ operator new()

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 96 of file alloc_type.hpp.

◆ operator new[]()

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.

Definition at line 103 of file alloc_type.hpp.


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