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: The taming of the before-gc-hook (was Re: Upcoming 1.3.2 release)


Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se> writes:
> You can always arrange for this yourself by letting the free function
> of your own objects call a slot you have reserved for such a function.

Ah, yes of course!!  I think that means: Wrap a smob around the user's
data and let the container object point to the linked list of these
smobs. When the container's mark function is called do not mark those
smobs that hold a weak reference to the container. And when the smob's
free function is called they can easily remove themselfs from the
linked list and invalidate associated data.

Uh oh!  I've wasted more than five hours on sunday just to find out
how to track these weak references.  And the easy answer is: wrap a
smob around them...


Jost

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