|
|
Orchid XP v8 wrote:
> Obviously, stopping your entire program (all parallel threads!) so you
> can run the GC isn't a fantastic idea. So various more sophisticated
> schemes have been invented (e.g., generational GC). In any case, for
> most designs of GC, the entire chain of objects will be reclaimed in a
> single pass of the GC. (Although it might be the next "major" rather
> than "minor" pass or something, depending on the exact design details.)
I could imagine that there is an optimization available when individual
references go out of scope (although simply deallocating those objects
should suffice), and in a language that checks these things, there may
be opportunities whenever a reference is changed.
Not a full-blown check of every dynamic object (which would hurt
performance), but a limited check. But I'll leave the details to
whoever implements it.
In a language that doesn't have built-in GC, properly encapsulating
references, and properly building destructors, could do most of the GC
work; but then the point of GC is to allow the programmer to forget
these things. But at least I have something to consider if I ever do a
ground-upwards rewrite of my modeler (which is in C++).
Regards,
John
Post a reply to this message
|
|