System.Web.Caching.CacheItemPriorityQueue.ResizeHeap C# (CSharp) Method

ResizeHeap() private method

private ResizeHeap ( int newSize ) : void
newSize int
return void
		void ResizeHeap (int newSize)
		{
			//CacheItem[] oldHeap = heap;
			Array.Resize <CacheItem> (ref heap, newSize);
			
			// TODO: The code helps the GC in case the array is pinned. In such instance clearing
			// the old array will release references to the CacheItems stored in there. If the
			// array is not pinned, otoh, this is a waste of time.
			// Currently we don't know if the array is pinned or not so it's safer to always clear it.
			// However when we have more precise stack scanning the code should be
			// revisited.
			//
			// FIXME: code disabled for now as it causes NREX to be thrown in Bubble{Up,Down}
			//
			// if (oldHeap != null) {
			// 	((IList)oldHeap).Clear ();
			// 	oldHeap = null;
			// }
		}