By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,171 Members | 1,004 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,171 IT Pros & Developers. It's quick & easy.

can garbeg collector be assisted by compiler

P: n/a
Garbage collection is done at runtime .Then how compiler can assist it.
Compiler plays no role at runtime . It is stated so on link
"http://www.iecc.com/gclist/GC-faq.html#Common%20questions" .

Regards ,
Mangesh .

Jul 7 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
mangesh wrote:
Garbage collection is done at runtime .Then how compiler can assist it.
Compiler plays no role at runtime . It is stated so on link
"http://www.iecc.com/gclist/GC-faq.html#Common%20questions" .
The full quote reads: "Garbage collection is a part of a language's
runtime system, or an add-on library, perhaps assisted by the compiler,
the hardware, the OS, or any combination of the three, that
automatically determines what memory a program is no longer using, and
recycles it for other use. It is also known as 'automatic storage (or
memory) reclamation'."

Any compiler that helps (e.g., by inserting some extra code here or
there to help in GC) is outside the current C++ Standard on this point,
though "C++0x will most likely support optional garbage collection"
(http://www.artima.com/cppsource/cpp0x.html).

Cheers! --M

Jul 7 '06 #2

P: n/a
In article <11**********************@p79g2000cwp.googlegroups .com>,
ma************@walla.com says...
Garbage collection is done at runtime .Then how compiler can assist it.
Compiler plays no role at runtime . It is stated so on link
"http://www.iecc.com/gclist/GC-faq.html#Common%20questions" .
The compiler itself plays no role at runtime (in the traditional
compiler model) but that's more or less irrelevant. The compiler can
do things like ensuring that (at runtime) the garbage collector can
figure out what's a pointer vs. some other value that might happen to
look like a pointer.

Some concurrent garbage collectors also require reduced access to
data at particular times. They might (for example) allow data to be
read, but not modified while garbage collection is taking place. Such
a write barrier nearly always needs at least some support from the
compiler. Likewise, there are other forms of GC that require a read
barrier at times.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Jul 7 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.