Re: My arguments
Larry Evans <[email protected]> Wed, 24 Nov 2004 13:30:57 -0700
| Newsgroups | gmane.comp.gnome.mono.garbage-collection |
|---|---|
| Message-ID | <[email protected]> |
On 11/22/2004 09:08 AM, Paolo Molaro wrote: [snip] > I was talking about tracking the pointers in the stack or registers > of a thread. Doing it precisely for the heap is easy. Doing it for the stack > is much harder, since it needs the jit to properly report them Assume that a gc__ managed c++ class, Base, has a virtual function which tracks the contained heap pointers. When Base::CTOR is called, the vtbl has an entry for the Base heap pointer. However, if Base is actually part of Derived, then when Derived::CTOR is called this virtual function tracks the heap pointers for both Base and Derived. This seems analagous to stack frames. If, at the top of all stack frames, there's a function pointer to track the heap pointers in the stack, then as each new stack frame is entered, the pointer is updated to reflect the newly stacked frame as well as all previous frames. Couldn't the virtual function implementation in c++ also be used by the compiler to track heap pointers on the stack? IOW, if it's easy to track pointers in a class, then, based on the above analogy, it would seem pretty easy to adapt the compiler to do it for the stack. Am I missing something? Thanks, Larry. _______________________________________________ Mono-gc-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-gc-list