What kind of objects can you possibly have where you can just set the variable to null, besides very simple objects? All the objects in my engine are referenced by a list that is a field of the world class, as well as the child entities, parent entity, and anything else that might use it.
It seems like if you want GC for anything else than simple math classes, you are hard-coding too much in your app. I can't even use GC for textures because I store them in a map sorted by file path, so they each only get loaded once.
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.
It seems like if you want GC for anything else than simple math classes, you are hard-coding too much in your app. I can't even use GC for textures because I store them in a map sorted by file path, so they each only get loaded once.
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.