コード例 #1
0
        internal NativeMappedAggregator(int capacity, Allocator allocator, TAggregator shell = default)
        {
            CollectionHelper.CheckIsUnmanaged <TKey>();
            CollectionHelper.CheckIsUnmanaged <TData>();
            mAllocator = allocator;
            // Bucket size is bigger to reduce collisions
            UnsafeHashMapData.AllocateHashMap <TKey, TData>(capacity, capacity << 1, allocator, out mBuffer);
            UnsafeHashMapBase <TKey, TData> .Clear(mBuffer);

            mShell = shell;
        }
コード例 #2
0
 /// <summary>
 /// Clears the container.
 /// </summary>
 /// <remarks>Containers capacity remains unchanged.</remarks>
 public void Clear()
 {
     UnsafeHashMapBase <TKey, TValue> .Clear(m_Buffer);
 }