MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / initialize

Method initialize

OgreMain/src/Math/Array/OgreArrayMemoryManager.cpp:94–120  ·  view source on GitHub ↗

-----------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

92 ArrayMemoryManager::~ArrayMemoryManager() {}
93 //-----------------------------------------------------------------------------------
94 void ArrayMemoryManager::initialize()
95 {
96 assert( mUsedMemory == 0 &&
97 "Calling initialize twice"
98 " with used slots will cause dangling ptrs" );
99 destroy();
100
101 size_t i = 0;
102 MemoryPoolVec::iterator itor = mMemoryPools.begin();
103 MemoryPoolVec::iterator endt = mMemoryPools.end();
104
105 while( itor != endt )
106 {
107 // *itor = reinterpret_cast<char*>(_aligned_malloc(mMaxMemory * ElementsMemSize[i],
108 // 16));
109 *itor =
110 (char *)OGRE_MALLOC_SIMD( mMaxMemory * mElementsMemSizes[i], MEMCATEGORY_SCENE_OBJECTS );
111 if( mInitRoutines && mInitRoutines[i] )
112 mInitRoutines[i]( *itor, 0, 0, 0, 0, mMaxMemory, mElementsMemSizes[i] );
113 else
114 memset( *itor, 0, mMaxMemory * mElementsMemSizes[i] );
115 ++i;
116 ++itor;
117 }
118
119 initializeEmptySlots( 0 );
120 }
121 //-----------------------------------------------------------------------------------
122 void ArrayMemoryManager::destroy()
123 {

Callers 6

startupMethod · 0.45
growToDepthMethod · 0.45
growToDepthMethod · 0.45
growToDepthMethod · 0.45
_growToDepthMethod · 0.45

Calls 4

initializeEmptySlotsFunction · 0.85
destroyFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected