A Garbage-free Collection Library

Hello everyone!
Would there be any interest in a library containing garbage-free object collections?
Or let me know if this already exists; I couldn’t find it anywhere.

As many of you probably know, the System.Collections namespace contains many valuable algorithms and data structures like List, HashSet and Dictionary.
The problem is that they where designed for an environment where garbage is fine.
Depending on the game you want to develop, the garbage collector can be your worst enemy, causing unacceptable CPU spikes.
I’m not only talking about for versus foreach. There is a lot more garbage being generated behind the scenes, even with simple adds or removes.

Sure you can use these standard collections, but you have to be careful with what you do.
Wouldn’t it be nice if you know it wouldn’t create garbage, whatever you do?

Well List and Dictionary don’t necessarily create garbage, unless a) you resize them or b) you change the contents so it would depend really. But in general I’m interested in anything that doesn’t create garbage :slight_smile:

Absolutely! That’s my point.
How many times do you a) resize and/or b) change the contents of your collections: all the time! (for me at least)
Sure you can use these standard collections, but you have to be careful with what you do.
Wouldn’t it be nice if you know it wouldn’t create garbage, whatever you do?