public void Dispose() { this.count = 0; this.capacity = 0; this.freeSlots.Dispose(); MemoryUtility.Free <EntityInChunk>(this.entitiesInChunk); }
public void Dispose() { this.count = 0; this.capacity = 0; MemoryUtility.Free(this.m_Hashes); MemoryUtility.Free(this.m_Elements); }
public void Dispose() { this.archetypeStore->Dispose(); this.entityStore->Dispose(); this.queryCache->Dispose(); MemoryUtility.Free(this.archetypeStore); }
public void Dispose() { for (int i = 0; i < this.count; ++i) { ChunkPool.Free(this.chunks[i]); } MemoryUtility.Free(this.chunks); }
public void Dispose() { for (int i = 0; i < this.count; ++i) { this.archetypes[i].Dispose(); } this.count = 0; this.capacity = 0; this.typeLookup.Dispose(); MemoryUtility.Free <Archetype>(this.archetypes); }
public void Dispose() { for (int i = 0; i < this.count; ++i) { MemoryUtility.Free(this.queries[i].componentTypes); MemoryUtility.Free(this.queries[i].archetypes); } this.count = 0; this.capacity = 0; this.typeLookup.Dispose(); MemoryUtility.Free(this.queries); }
public void Dispose() { this.chunkArray->Dispose(); MemoryUtility.Free <ArchetypeChunkArray>(this.chunkArray); if (this.componentCount > 0) { MemoryUtility.Free(this.componentTypes); MemoryUtility.Free(this.componentSizes); MemoryUtility.Free(this.componentOffsets); } }
internal void MatchArchetypesToQueryData(EntityQueryData *queryData) { var count = this.archetypeStore->count; var unmatchedArchetypeCount = count - queryData->matchedArchetypeCount; var archetypes = this.archetypeStore->archetypes + queryData->matchedArchetypeCount; // Update the query data to the current archetype count. This only // works because a created archetype cannot be removed. queryData->matchedArchetypeCount = count; if (unmatchedArchetypeCount == 0) // Can this be done better? { return; } var matchCount = 0; if (unmatchedArchetypeCount <= 16) { var matchingArchetypes = stackalloc Archetype *[unmatchedArchetypeCount]; for (int i = 0; i < unmatchedArchetypeCount; ++i, ++archetypes) // This loop can be written shorter and better! { if (ArchetypeMatchesQueryFilter(archetypes, queryData)) { matchingArchetypes[matchCount++] = archetypes; } } AppendArchetypesToQueryData(queryData, matchingArchetypes, matchCount); } else { var matchingArchetypes = MemoryUtility.MallocPtrArray <Archetype>(unmatchedArchetypeCount); for (int i = 0; i < unmatchedArchetypeCount; ++i, ++archetypes) { if (ArchetypeMatchesQueryFilter(archetypes, queryData)) { matchingArchetypes[matchCount++] = archetypes; } } AppendArchetypesToQueryData(queryData, matchingArchetypes, matchCount); MemoryUtility.Free(matchingArchetypes); } }
public void Dispose() { this.count = 0; this.capacity = 0; MemoryUtility.Free <int>(this.slots); }
public static void Free(Chunk *chunk) { MemoryUtility.Free <Chunk>(chunk); --rentedCount; }