From: Matt Armstrong Date: 2001-11-29T04:22:52+09:00 Subject: [ruby-talk:26827] Re: Ref Counting (was KDE or GNOME curiosity question...) "Mark Hahn" writes: > My thoughts on ref counting are really academic. I am not arguing > for anything. I don't even know where these thoughts are leading. > But... > > It seems to me that there are two distinctly seperate goals of > garbage collection: > > 1) Free up memory > 2) Finalize objects. > > Obviously goal 1 is better done with lazy processing. That is the > Java/Ruby GC approach. Goal 2 is better done with ref counting. > > Most objects need goal 1 (not all, but most). Only a few objects > need goal 2. Having goal 2 be met by an optional feature that costs > more overhead, only on objects that need it, would be logical. I'm not sure how optional ref counting can be accomplished without overhead everywhere. If object A needed ref counting and object B didn't, ruby would somehow need to increment the reference count of A and not of B when a new object gains a reference to A and B. That implies some run time check or indirection for both objects, true? -- matt