public NativeHashSet(int capacity, Allocator allocator) { NativeHashSetData.AllocateHashSet <T>(capacity, allocator, out buffer); this.allocator = allocator; #if ENABLE_UNITY_COLLECTIONS_CHECKS DisposeSentinel.Create( out m_Safety, out m_DisposeSentinel, callSiteStackDepth: 8, allocator: allocator); #endif Clear(); }
void Deallocate() { NativeHashSetData.DeallocateHashSet(buffer, allocator); buffer = null; }