MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / operator new

Method operator new

Engine/source/console/engineObject.cpp:122–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120
121#ifndef TORQUE_DISABLE_MEMORY_MANAGER
122void* EngineObject::operator new( size_t size )
123{
124 AssertFatal( IEngineObjectPool::DEFAULT, "EngineObject::new - No default pool set!" );
125
126 void* ptr = IEngineObjectPool::DEFAULT->allocateObject( size TORQUE_TMM_LOC );
127 if( !ptr )
128 {
129 Platform::AlertOK( "Torque Memory Error", "Out of memory. Shutting down.\n");
130 Platform::forceShutdown( -1 );
131 }
132
133 EngineObject* object = reinterpret_cast< EngineObject* >( ptr );
134 object->mEngineObjectPool = IEngineObjectPool::DEFAULT;
135
136 return ptr;
137}
138#endif
139
140//-----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 1

allocateObjectMethod · 0.80

Tested by

no test coverage detected