MCPcopy Create free account
hub / github.com/anjo76/angelscript / FreeUnusedMemory

Method FreeUnusedMemory

sdk/angelscript/source/as_memory.cpp:193–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193void asCMemoryMgr::FreeUnusedMemory()
194{
195 // It's necessary to protect the scriptNodePool from multiple
196 // simultaneous accesses, as the parser is used by several methods
197 // that can be executed simultaneously.
198 ENTERCRITICALSECTION(cs);
199
200 int n;
201 for( n = 0; n < (signed)scriptNodePool.GetLength(); n++ )
202 userFree(scriptNodePool[n]);
203 scriptNodePool.Allocate(0, false);
204
205 LEAVECRITICALSECTION(cs);
206
207 // The engine already protects against multiple threads
208 // compiling scripts simultaneously so this pool doesn't have
209 // to be protected again.
210 for( n = 0; n < (signed)byteInstructionPool.GetLength(); n++ )
211 userFree(byteInstructionPool[n]);
212 byteInstructionPool.Allocate(0, false);
213}
214
215void *asCMemoryMgr::AllocScriptNode()
216{

Callers 1

BuildCompletedMethod · 0.80

Calls 2

GetLengthMethod · 0.45
AllocateMethod · 0.45

Tested by

no test coverage detected