Christoffer LernC6 wrote:>> But what language are you planning use for the implementation? If you>> choose C++, then it is hard to find the root set. Suppose you create>> object for use in your language; then global objects and those in th>> stack should be registered somehow for the tracing, but those on the>> heap should not, as the are live when they can be traced from the other.>> I was thinking of using C for implementation, but does that matter? As> long as I implement the language in a non GC:ed language I will have> to take care of writing the GC myself (or for C, use the Bohm> conservative GC).

If you want to make a tracing GC in C++, then you will have to keep
track of where elements are located by hand.

For example, if you have class Object which keep track of a polymorphic
pointer, and a
class S {
Object x, y;
...
};

Then in
T f(...) {
Object w = new S(...);
...
}
the w belongs to the root set, as it is allocation on the function
stack, whereas the S::x, S::y are on the heap, as they are allocated via
the "new S".