jtmueller / Collections.Pooled

Fast, low-allocation ports of List, Dictionary, HashSet, Stack, and Queue using ArrayPool and Span.
MIT License
547 stars 48 forks source link

How about call GC.SuppressFinalize(this) to prevent add to finalization queue. #49

Closed doublnt closed 1 year ago

doublnt commented 1 year ago
   /// <summary>
        /// Returns the internal buffers to the ArrayPool.
        /// </summary>
        public void Dispose()
        {
            ReturnArray();
            _size = 0;
            _version++;
        }

https://github.com/jtmueller/Collections.Pooled/blob/86cb27aa7ef64f52f169d0e2f7d512493ddc1b51/Collections.Pooled/PooledList.cs?2#L1568