MCPcopy Create free account
hub / github.com/defold/defold / AcquireInstanceIndex

Function AcquireInstanceIndex

engine/gameobject/src/gameobject/gameobject.cpp:1023–1035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1021 }
1022
1023 uint32_t AcquireInstanceIndex(HCollection hcollection)
1024 {
1025 Collection* collection = hcollection->m_Collection;
1026 dmMutex::Lock(collection->m_Mutex);
1027 uint32_t index = INVALID_INSTANCE_POOL_INDEX;
1028 if (collection->m_InstanceIdPool.Remaining() > 0)
1029 {
1030 index = collection->m_InstanceIdPool.Pop();
1031 }
1032 dmMutex::Unlock(collection->m_Mutex);
1033
1034 return index;
1035 }
1036
1037 void ReleaseInstanceIndex(uint32_t index, Collection* collection)
1038 {

Callers 5

TEST_FFunction · 0.85
FactorySpawnFunction · 0.85
Lua_SpawnFunction · 0.85
DoSpawnFunction · 0.85
CreateGOBonesFunction · 0.85

Calls 4

LockFunction · 0.50
UnlockFunction · 0.50
RemainingMethod · 0.45
PopMethod · 0.45

Tested by 3

TEST_FFunction · 0.68
FactorySpawnFunction · 0.68
Lua_SpawnFunction · 0.68