Blitzmax - A gaming language?

Miscellaneous Forums/General Discussion/Blitzmax - A gaming language?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

GC is pretty useless unless you are writing a very simple program, or only relying on it for simple things like math objects. I don't mind it either way, and I am not going to complain about it, but I could go with or without it and it wouldn't make any difference. Even if circular references were detected I would still have to free everything manually. So to me it is just wasted CPU cycles, for most things. But it is nice for my vec3, vec4 mat4, aabb, etc. classes.

I could be wrong, since I don't use C# every day, but I've written a few prototype apps and code with it, and all my classes (even some fairly complex custom communication protocols) have always been deletable by setting to null.

Remember - if the garbage collector is fully functional and will actually reliably delete anything that is no longer referenced, all you really have to do is null all references to the object, and it will simply disappear. All objects owned by that class will be deleted too, unless something else references them.

For example, a Entity object, might contain a reference to a Mesh object (vertex/index data), a Material object, a few Vector3's (position, scale), etc. Usually you'll keep a list of used Entity's in your main loop or something, and they'll get rendered, etc. To delete an entity, simply removing it from your list will cause it to be no longer referenced, and therefore the Entity, along with some of it's sub-objects, to be deleted. If the Material object or Mesh object was used somewhere else, it will remain in memory thanks to the garbage collector.

That's how I see it, at least. Like I say I may be wrong because I'm not very experienced with GC coding.