This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Scm_sloppy_assq mostly fixed, still real slow
- To: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Subject: Re: Scm_sloppy_assq mostly fixed, still real slow
- From: Jost Boekemeier <jostobfe at linux dot zrz dot TU-Berlin dot DE>
- Date: 16 Jun 2000 14:20:06 +0200
- Cc: Guile Mailing List <guile at sourceware dot cygnus dot com>
- References: <Pine.LNX.4.21.0006160923350.25530-100000@marvin.ida.ing.tu-bs.de>
> With the new mechanism, yes. And, I think this is a good thing,
> since calls to protect/unprotect nest. Thus, if an object was
> protected from two different places, but (erroneously) freed too
> often, there might still be some code that relies on the object
> still being protected.
No, I currently use it the other way 'round. I first unprotect
individual objects and then, when a lock is removed the complete chain
is unprotected. Thus an object can be unprotected twice. This is a
quite common situation.
However, the choice is arbitrary and the old code was also correct. I
don't argue against the change but I think such changes should be
announced somwhere, at least the documentation should be updated:
/* Protect OBJ from the garbage collector. OBJ will not be freed,
even if all other references are dropped, until someone applies
scm_unprotect_object to it. This function returns OBJ.
Calls to scm_protect_object and scm_unprotect_object nest. For
every object O, there is a counter which scm_protect_object(O)
increments and scm_unprotect_object(O) decrements, if it is greater
than zero. Otherwise, undefined behaviour occurs. If an object's
counter is greater than zero, the garbage collector will not free
it. */
Jost