 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ganesh Guest
|
Posted: Thu Nov 09, 2006 5:00 pm Post subject: How does a GC compute the root set? |
|
|
I am not sure where to ask this question. Hence, I am asking it here (a
intelligent random choice!).
How does a garbage collector compute the root set? By scanning the
entire static & stack segements of the program? Or using the symbol
table generated during the compile time.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
Francis Glassborow Guest
|
Posted: Thu Nov 09, 2006 7:41 pm Post subject: Re: How does a GC compute the root set? |
|
|
In article <1163038569.005909.273170 (AT) f16g2000cwb (DOT) googlegroups.com>,
Ganesh <ganeshb (AT) gmail (DOT) com> writes
| Quote: | I am not sure where to ask this question. Hence, I am asking it here (a
intelligent random choice!).
How does a garbage collector compute the root set? By scanning the
entire static & stack segements of the program? Or using the symbol
table generated during the compile time.
|
This is one hundred per cent off topic. You need to post to a group
involved in general programming algorithms. There are many different
ways to implement garbage collection. Just as there are several forms of
garbage collection each with its strengths and weaknesses.
None of these currently have anything to do with C++ (or with Java etc.)
--
Francis Glassborow ACCU
Author of 'You Can Do It!' and "You Can Program in C++"
see http://www.spellen.org/youcandoit
For project ideas and contributions:
http://www.spellen.org/youcandoit/projects
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
James Kanze Guest
|
Posted: Sat Nov 11, 2006 12:56 am Post subject: Re: How does a GC compute the root set? |
|
|
Francis Glassborow wrote:
| Quote: | In article <1163038569.005909.273170 (AT) f16g2000cwb (DOT) googlegroups.com>,
Ganesh <ganeshb (AT) gmail (DOT) com> writes
I am not sure where to ask this question. Hence, I am asking it here (a
intelligent random choice!).
How does a garbage collector compute the root set? By scanning the
entire static & stack segements of the program? Or using the symbol
table generated during the compile time.
This is one hundred per cent off topic.
|
Not completely, if the real question concerns how this works in
C++. There are legitimate questions if the compiler doesn't
collaborate, by providing type information. Given C++'s
undiscriminated unions, of course, there is a limit to just how
much information the compiler can provide, but I believe that
there are some "mostly precise" garbage collectors for C and
C++; garbage collectors which use a compiler modified to provide
the necessary information whenever possible, and which revert to
conservative collection only when the information isn't
available. (But in my case, it's a case of having talked with
someone who talked with someone... I'm not sure where to even
begin looking for additional information.)
Also, I would say that discussion of the Boehm collector is on
target, at least as much as Boost, or any other relatively
portable and widely used library. In the case of the Boehm
collector, of course, it is a purely conservative collector,
without any collaboration with the compiler. As such, the root
set does consist of all "words" in the static data (data and bss
segments in traditional Unix compilers) and all active stacks.
--
James Kanze (GABI Software) email:james.kanze (AT) gmail (DOT) com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
Seungbeom Kim Guest
|
Posted: Sat Nov 11, 2006 4:04 pm Post subject: Re: How does a GC compute the root set? |
|
|
Alberto Ganesh Barbati wrote:
| Quote: |
As a matter of fact, the most recent draft of the C++ standard
explicitly states the intent to introduce garbage collection in the C++
language in clause §3.7.5.
|
I checked N2134 (dated 2006-11-03: only a week ago!) and it doesn't have
§3.7.5. Did you mean a different verse, or a different document?
--
Seungbeom Kim
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|