Example #1
0
 public void Dispose()
 {
     this.count    = 0;
     this.capacity = 0;
     this.freeSlots.Dispose();
     MemoryUtility.Free <EntityInChunk>(this.entitiesInChunk);
 }
Example #2
0
 public void Dispose()
 {
     this.count    = 0;
     this.capacity = 0;
     MemoryUtility.Free(this.m_Hashes);
     MemoryUtility.Free(this.m_Elements);
 }
Example #3
0
        public void Dispose()
        {
            this.archetypeStore->Dispose();
            this.entityStore->Dispose();
            this.queryCache->Dispose();

            MemoryUtility.Free(this.archetypeStore);
        }
Example #4
0
        public void Dispose()
        {
            for (int i = 0; i < this.count; ++i)
            {
                ChunkPool.Free(this.chunks[i]);
            }

            MemoryUtility.Free(this.chunks);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
        }
Example #7
0
        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);
            }
        }
Example #8
0
        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);
            }
        }
Example #9
0
 public void Dispose()
 {
     this.count    = 0;
     this.capacity = 0;
     MemoryUtility.Free <int>(this.slots);
 }
Example #10
0
 public static void Free(Chunk *chunk)
 {
     MemoryUtility.Free <Chunk>(chunk);
     --rentedCount;
 }