| 300 | } |
| 301 | |
| 302 | asIScriptContext *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 | |
| 318 | void CScriptMgr::ReturnContextToPool(asIScriptContext *ctx) |
| 319 | { |
nothing calls this directly
no test coverage detected