Re: Re: Re: Re: my garbage collector sucks
"Mark Hahn" <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <[email protected]> |
Greg Ewing wrote: > Mark Hahn <[email protected]>: > >> I put in code to mark objects not only in the mark phase but when >> new objects are created, when objects are touched or modified and I >> think when objects are being pointed to and the pointers are mucked >> with. > > If you have to set the marked bit of an object whenever any reference > to it is stored anywhere, seems to me this has almost as much > complexity and overhead as reference counting -- and is just as > bad for the CPU cache. > > Also, that only takes care of the directly referenced object. What > about other objects referenced by that object? I haven't revisited this yet, but everything you say is valid.