Related articles |
---|
Compile Time Garbage Collection impossible? the.real.doctor.zoidberg@gmail.com (2006-09-22) |
Re: Compile Time Garbage Collection impossible? pjb@informatimago.com (Pascal Bourguignon) (2006-09-25) |
RE: Compile Time Garbage Collection impossible? qtj-query@shaw.ca (Quinn Tyler Jackson) (2006-09-25) |
RE: Compile Time Garbage Collection impossible? daniele@infoconex.com (Daniele Terdina) (2006-09-25) |
Re: Compile Time Garbage Collection impossible? dido@imperium.ph (Rafael 'Dido' Sevilla) (2006-09-25) |
Re: Compile Time Garbage Collection impossible? kym@ukato.freeshell.org (russell kym horsell) (2006-09-25) |
Re: Compile Time Garbage Collection impossible? paul.biggar@gmail.com (Paul Biggar) (2006-09-25) |
[15 later articles] |
From: | the.real.doctor.zoidberg@gmail.com |
Newsgroups: | comp.compilers |
Date: | 22 Sep 2006 22:29:03 -0400 |
Organization: | Compilers Central |
Keywords: | GC, question |
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
comp.compilers page.
Search the
comp.compilers archives again.