Esempio n. 1
0
        private HashMap(int capacity)
        {
            this.count      = 0;
            this.capacity   = capacity;
            this.m_Hashes   = MemoryUtility.Malloc <int>(this.capacity);
            this.m_Elements = MemoryUtility.Malloc <T>(this.capacity);

            MemoryUtility.MemSet(this.m_Hashes, 0, sizeof(int) * this.capacity);
        }
Esempio n. 2
0
        public static void InitializeComponentData(Chunk *chunk, int index, int count)
        {
            var sizes          = chunk->archetype->componentSizes;
            var offset         = chunk->archetype->componentOffsets;
            var componentCount = chunk->archetype->componentCount;

            for (int i = 0; i < componentCount; ++i)
            {
                var offsetInBuffer = chunk->buffer + offset[i];

                // ZeroMemory would possibly be the better call, but it's internal.
                MemoryUtility.MemSet(offsetInBuffer + (sizes[i] * index), 0, sizes[i] * count);
            }
        }