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

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

            MemoryUtility.Free(this.chunks);
        }
示例#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);
        }
示例#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);
        }
示例#7
0
文件: Archetype.cs 项目: dn9090/Checs
        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);
            }
        }
示例#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);
            }
        }
示例#9
0
 public void Dispose()
 {
     this.count    = 0;
     this.capacity = 0;
     MemoryUtility.Free <int>(this.slots);
 }
示例#10
0
文件: ChunkPool.cs 项目: dn9090/Checs
 public static void Free(Chunk *chunk)
 {
     MemoryUtility.Free <Chunk>(chunk);
     --rentedCount;
 }