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

Method PrepareEngine

sdk/angelscript/source/as_scriptengine.cpp:3341–3441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3339
3340
3341void asCScriptEngine::PrepareEngine()
3342{
3343 if( isPrepared ) return;
3344 if( configFailed ) return;
3345
3346 asUINT n;
3347 for( n = 0; n < scriptFunctions.GetLength(); n++ )
3348 {
3349 // Determine the host application interface
3350 if( scriptFunctions[n] && scriptFunctions[n]->funcType == asFUNC_SYSTEM )
3351 {
3352 if( scriptFunctions[n]->sysFuncIntf->callConv == ICC_GENERIC_FUNC ||
3353 scriptFunctions[n]->sysFuncIntf->callConv == ICC_GENERIC_METHOD )
3354 PrepareSystemFunctionGeneric(scriptFunctions[n], scriptFunctions[n]->sysFuncIntf, this);
3355 else
3356 PrepareSystemFunction(scriptFunctions[n], scriptFunctions[n]->sysFuncIntf, this);
3357 }
3358 }
3359
3360 // Validate object type registrations
3361 for( n = 0; n < registeredObjTypes.GetLength(); n++ )
3362 {
3363 asCObjectType *type = registeredObjTypes[n];
3364 if( type && !(type->flags & asOBJ_SCRIPT_OBJECT) )
3365 {
3366 bool missingBehaviour = false;
3367 const char *infoMsg = 0;
3368
3369 // Verify that GC types have all behaviours
3370 if( type->flags & asOBJ_GC )
3371 {
3372 if (type->flags & asOBJ_REF)
3373 {
3374 if (type->beh.addref == 0 ||
3375 type->beh.release == 0 ||
3376 type->beh.gcGetRefCount == 0 ||
3377 type->beh.gcSetFlag == 0 ||
3378 type->beh.gcGetFlag == 0 ||
3379 type->beh.gcEnumReferences == 0 ||
3380 type->beh.gcReleaseAllReferences == 0)
3381 {
3382 infoMsg = TXT_GC_REQUIRE_ADD_REL_GC_BEHAVIOUR;
3383 missingBehaviour = true;
3384 }
3385 }
3386 else
3387 {
3388 if (type->beh.gcEnumReferences == 0)
3389 {
3390 infoMsg = TXT_VALUE_GC_REQUIRE_GC_BEHAVIOUR;
3391 missingBehaviour = true;
3392 }
3393 }
3394 }
3395 // Verify that scoped ref types have the release behaviour
3396 if( type->flags & asOBJ_SCOPED )
3397 {
3398 if( type->beh.release == 0 )

Callers 4

ReadMethod · 0.80
BuildMethod · 0.80
CompileGlobalVarMethod · 0.80
CompileFunctionMethod · 0.80

Calls 4

GetLengthMethod · 0.45
FormatMethod · 0.45
AddressOfMethod · 0.45

Tested by

no test coverage detected