jtmueller / Collections.Pooled

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

Nested pooled collections crash the Visual Studio heap snapshot #37

Open thatcosmonaut opened 4 years ago

thatcosmonaut commented 4 years ago

Describe the bug When nesting pooled collections inside each other, the debugger crashes when taking a heap snapshot.

To Reproduce Create a nested collection, for example PooledDictionary<int, PooledSet<int>> and attempt to take a heap snapshot in the Visual Studio debugger. This occurs in both the prerelease and 1.0 Nuget packages.

Expected behavior The debugger should not crash.

Is it also possible that nesting pooled collections is just not recommended usage? I'm not really sure how it works internally.