Juergen Boemmels wrote:
> 
> Benjamin Goldberg <[EMAIL PROTECTED]> writes:
> 
> > I would like for Parrot to have some way of creating Weak References;
> > I think that this is probably a vital feature.
> >
> > The way I envision this is as follows.  The following typedef and new
> > function would be added:
> >
> > typedef void (*pobject_died_cb)(INTERP, PMC* who_asked,
> >    Pobj* weakref, void *callback_info);
> > void pobject_weakref(INTERP, pobject_died_cb callback,
> >    Pobj* weakref, void *callback_info);
> 
> This might be sometimes useful. Keeping a container of active objects
> like filehandles or windows for example. In this case it can't mark
> the reference because this would make the object active forever.
> 
> > Inside of a PMC*'s mark method, it registers callbacks (using the
> > above function) so that it will be informed about what to do if the
> > object to which it weakly refers to is found to not be alive at the
> > end of the DOD sweep.
> 

Reply via email to