Re: More on garbage collection
- From: torbenm@xxxxxxxxxxxxx (Torben Ægidius Mogensen)
- Date: 04 Jul 2005 11:33:28 +0200
David Gay <dgay@xxxxxxxxxxxxxxxxxxxxx> writes:
> torbenm@xxxxxxxxxxxxx (Torben Ægidius Mogensen) writes:
> > David Gay <dgay@xxxxxxxxxxxxxxxxxxxxx> writes:
> > > If you have to invoke a destructor, I'm not sure where automatic
> > > garbage collection enters the discussion.
> >
> > The garbage collector can invoke the destructor on
> > no-longer-referenced objects before they are (automatically)
> > deallocated.
>
> That doesn't work if the object references itself (a cycle), at which
> point a reference-counted garbage collector will not know it should
> invoke the destructor.
You wouldn't use reference counting for GC if you have cyclic
structures anyway. The main potential problem is that the order in
which destructors are invoked is unspecified, so you would probably
want destructors to only access local fields (i.e., not follow
pointers to other objects).
Torben
.
- References:
- Re: More on garbage collection
- From: Robert A Duff
- Re: More on garbage collection
- From: Joe Seigh
- Re: More on garbage collection
- From: David Gay
- Re: More on garbage collection
- From: Joe Seigh
- Re: More on garbage collection
- From: David Gay
- Re: More on garbage collection
- From: Torben Ægidius Mogensen
- Re: More on garbage collection
- From: David Gay
- Re: More on garbage collection
- Prev by Date: Re: GEEKS speak to me ! please !
- Next by Date: Re: Anand: XBox360 CPU and PS3 Cell CPU have poor realworld performance
- Previous by thread: Re: More on garbage collection
- Next by thread: Re: More on garbage collection
- Index(es):
Relevant Pages
|