|Compile Time Garbage Collection impossible? firstname.lastname@example.org (2006-09-22)|
|Re: Compile Time Garbage Collection impossible? email@example.com (Pascal Bourguignon) (2006-09-25)|
|RE: Compile Time Garbage Collection impossible? firstname.lastname@example.org (Quinn Tyler Jackson) (2006-09-25)|
|RE: Compile Time Garbage Collection impossible? email@example.com (Daniele Terdina) (2006-09-25)|
|Re: Compile Time Garbage Collection impossible? firstname.lastname@example.org (Rafael 'Dido' Sevilla) (2006-09-25)|
|Re: Compile Time Garbage Collection impossible? email@example.com (russell kym horsell) (2006-09-25)|
|Re: Compile Time Garbage Collection impossible? firstname.lastname@example.org (Paul Biggar) (2006-09-25)|
|[15 later articles]|
|Date:||22 Sep 2006 22:29:03 -0400|
|Posted-Date:||22 Sep 2006 22:29:03 EDT|
Why isn't Compile-Time-Garbage-Collection feasible? Consider a Java
compiler which produces assembly code for a specific target instead of
Java's bytecode cenario. The objective is to use Java without the need
for a GC or VM.
I'm asking why it isn't possible because otherwise there would be at
least one compiler to use that technique, instead of having to run a
GC in the VM.
When a program is compiled, the compiler has to transverse all its
code to ensure type safety (for safe languages), so what would be the
problem in "freeing" objects after their scope, or even better, after
the last reference in their scope?
Thank you for any insight on this matter.
[Local objects are usually stack allocated and freed at end of scope.
You need GC when you do dynamic allocation, and chain stuff into lists
and trees of data structures. -John]
Return to the
Search the comp.compilers archives again.