The Garbage Collector: Very Bad

BlitzMax Forums/BlitzMax Beginners Area/The Garbage Collector: Very Bad

Ok, so I figured out a completely different solution to my previous thread using Types instead of Arrays

However, now I've stumbled upon something that could land me in some deep trouble... the garbage collector

Back when my engine was in B+ I had multiple systems that used type instances that werent permenantly refered to by a variable

These systems will still use such when I convert them to BMax

in B+ this wasnt a problem, when I needed the type instances I simply found them again using For..Each and all was well, but in BMax theres that garbage collector which if I understand right will gobble up my Type Instances as soon as theres no longer anything pointing at them

Of course, I can turn the Garbage Collector off, but this leaves me with no safe way to get rid of type instances once I'm done with them, as soon as I call the garbage collector to get rid of one thing, or to get rid of anything else it cleans up, all of my other type instances are gone too

Due to the manner in which such type instances are spawned, it simply isnt possible to keep a variable pointing at them the entire time, as soon as the instance is filled the variable used to declair them is moved on to the next instance, or removed from scope

Further more, even if I can somehow convince the garbage collector to leave my anonymous type instances alone, there becomes no way for me to actualy delete them, they're stuck there in memory forever

A solution to this problem is of paramount importance for my project to continue, and I simply dont see anything resembling a way around it, any help would be MUCH apreciated