468,456 Members | 1,651 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,456 developers. It's quick & easy.

can garbeg collector be assisted by compiler

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
2 1273
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
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.

Similar topics

9 posts views Thread by Nick Jacobson | last post: by
3 posts views Thread by Martin Drautzburg | last post: by
5 posts views Thread by Charles T. | last post: by
5 posts views Thread by Ganesh | last post: by
13 posts views Thread by Mingnan G. | last post: by
31 posts views Thread by Mark Dufour | last post: by
4 posts views Thread by karthikbalaguru | last post: by
46 posts views Thread by Carlo Milanesi | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by subhajit12345 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.