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

Method AllocateGlobalProperty

sdk/angelscript/source/as_scriptengine.cpp:2757–2777  ·  view source on GitHub ↗

internal

Source from the content-addressed store, hash-verified

2755
2756// internal
2757asCGlobalProperty *asCScriptEngine::AllocateGlobalProperty()
2758{
2759 asCGlobalProperty *prop = asNEW(asCGlobalProperty);
2760 if( prop == 0 )
2761 {
2762 // Out of memory
2763 return 0;
2764 }
2765
2766 // First check the availability of a free slot
2767 if( freeGlobalPropertyIds.GetLength() )
2768 {
2769 prop->id = freeGlobalPropertyIds.PopLast();
2770 globalProperties[prop->id] = prop;
2771 return prop;
2772 }
2773
2774 prop->id = (asUINT)globalProperties.GetLength();
2775 globalProperties.PushLast(prop);
2776 return prop;
2777}
2778
2779// internal
2780void asCScriptEngine::RemoveGlobalProperty(asCGlobalProperty *prop)

Callers

nothing calls this directly

Calls 3

PopLastMethod · 0.80
PushLastMethod · 0.80
GetLengthMethod · 0.45

Tested by

no test coverage detected