Hello, I think the GC thread uses CNameSpace::/CFinalize::GcScanRoots & GcScanHandles to find all the references in the stacks, handles and finalize queue that 'point' to objects in the GCHeap. Thus it is able to find which objects are alive in the GCHeap.
If one of such objects contains pointers to other objects, these ones will be marked alive as well, won't they? I believe that ONLY the roots are located with these functions, and they're stored in a mark stack. Later this stack is traversed, and if an object pointed to by one of these roots contains more pointers to objects, these pointers are added to this stack. This way, eventually the stack will contain all the possible references that make objects in the heap alive, and then it'll be just a matter of following these references and marking them. My question is, am I right? And if so, where in the code is this mark stack populated. (I suppose that GcScanRoots and the like only traverse the stack (or other structures associated to them) but they don't locate the objects "pointed to by objects referenced from the stack", but only the roots) Thank you very much for your patience, and thank you in advance. Answer please, because this is an important matter for my project. =================================== This list is hosted by DevelopMentorŪ http://www.develop.com NEW! ASP.NET courses you may be interested in: 2 Days of ASP.NET, 29 Sept 2003, in Redmond http://www.develop.com/courses/2daspdotnet Guerrilla ASP.NET, 13 Oct 2003, in Boston http://www.develop.com/courses/gaspdotnet View archives and manage your subscription(s) at http://discuss.develop.com