This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: forcing guile to collect *all* garbage?


Michael Livshin <mike@olan.com> writes:

> No.  GC does its job well if my program doesn't run out of memory.  If
> the GC chooses to keep some objects forever because bothering with
> them would be inefficient, fine.  If a conservative GC never frees
> some object because something on the stack looks like a pointer to it,
> fine.  I don't want to know how the GC does it's magic.  I don't want
> to open the black box.  The GC's contract doesn't explicitly include
> object deallocation, though GC *may* deallocate objects to do its job.
> 
> If you want something a la C++'s "resource acquisition is allocation"
> pattern, don't assume that GC will help you here.
> 
> I'm not sure we disagree, actually ;).

I don't think so either ;). I was thinking of the correctness of the
gc, but backwards... what we're really insuring is that we won't free
any live objects; taking the time to actually stop and think for a
second (I really should do this more often ;'), this doesn't imply
that we'll free all dead objects. It's generally a pretty fair
assumption that we will, but that doesn't make any guarentee's that
they'll be freed within any given period of time, even if we know
they're free.

-- 
Greg