/// <summary> /// Constructs a new container with the specified initial capacity and type of memory allocation. /// </summary> /// <param name="capacity">The initial capacity of the container. If the list grows larger than its capacity, /// the internal array is copied to a new, larger array.</param> /// <param name="allocator">A member of the /// [Unity.Collections.Allocator](https://docs.unity3d.com/ScriptReference/Unity.Collections.Allocator.html) enumeration.</param> public UnsafeMultiHashMap(int capacity, Allocator allocator) { m_AllocatorLabel = allocator; // Bucket size if bigger to reduce collisions UnsafeHashMapData.AllocateHashMap <TKey, TValue>(capacity, capacity * 2, allocator, out m_Buffer); Clear(); }
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; }