mono/mono — pull request #933 by exony-craigminihan (2014-03-05 23:14:10+00:00)
Title: [Fix] Bugzilla #17897 - MemoryCacheEntryPriorityQueue throws out of boun...

...ds after shrink

- when MemoryCacheEntryPriorityQueue grows the timed items after a shrink
the size of the memory variable heapSize is wrong allowing an out-of-
bounds exception which would normally be prevented by bounds tests
- in order to fix the exception the BubbleUp() method was modified
to make it sort the timed item list, previously the logic did
not result in sorted items which the cache did not flush in a timely
manner
- BubbleDown() now just moves items down the array
- MemoryCacheEntry now implements IComparable
- A test case was added for the out-of-bounds exception