3 ms·
Why should the GC not be able to inform the programmer/language designer when memory is discarded? This is a non-issue. Besides, a kernel has to deal with plen
by jonathanstrange 8y ago
Why should the GC not be able to inform the programmer/language designer when memory is discarded? This is a non-issue.
Besides, a kernel has to deal with plenty of forms of nondeterminism anyway.
- arcticbull 8y agoHow would the GC in this case inform you when an object is deallocated? The whole point is scope can be extended arbitrarily by anything and that finalization may happen, or it may not, at some point in the future.
- jonathanstrange 8y agoIn the same way as a kernel deals with e.g. with the question whether an I/O interaction has succeeded or failed? But there is a difference, a GC can guarantee that finalization will happen in the future, unless someone switches off the machine by pressing the power button. I/O cannot make this guarantee. Do you maybe have hard real-time systems in mind when you say "deterministic"? I agree that a GC would be a bad idea for those, but these require validation of the hardware in combination with the software anyway.
- arcticbull 8y agoNo GC I've ever encountered can guarantee a given object will be collected or finalized.