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

Method PrepareContextFromPool

sdk/samples/game/source/scriptmgr.cpp:302–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302asIScriptContext *CScriptMgr::PrepareContextFromPool(asIScriptFunction *func)
303{
304 asIScriptContext *ctx = 0;
305 if( contexts.size() )
306 {
307 ctx = *contexts.rbegin();
308 contexts.pop_back();
309 }
310 else
311 ctx = engine->CreateContext();
312
313 int r = ctx->Prepare(func); assert( r >= 0 );
314
315 return ctx;
316}
317
318void CScriptMgr::ReturnContextToPool(asIScriptContext *ctx)
319{

Callers

nothing calls this directly

Calls 4

CreateContextMethod · 0.80
sizeMethod · 0.45
pop_backMethod · 0.45
PrepareMethod · 0.45

Tested by

no test coverage detected