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

Method FreeScriptNode

sdk/angelscript/source/as_memory.cpp:235–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235void asCMemoryMgr::FreeScriptNode(void *ptr)
236{
237 ENTERCRITICALSECTION(cs);
238
239 // Pre allocate memory for the array to avoid slow growth
240 if( scriptNodePool.GetLength() == 0 )
241 scriptNodePool.Allocate(100, 0);
242
243 scriptNodePool.PushLast(ptr);
244
245#ifdef AS_DEBUG
246 // clear the memory to facilitate identification of use after free
247 memset(ptr, 0xCDCDCDCD, sizeof(asCScriptNode));
248#endif
249
250 LEAVECRITICALSECTION(cs);
251}
252
253#ifndef AS_NO_COMPILER
254

Callers 1

DestroyMethod · 0.80

Calls 3

PushLastMethod · 0.80
GetLengthMethod · 0.45
AllocateMethod · 0.45

Tested by

no test coverage detected