[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: module GC bug

From: Mikael Djurfeldt
Subject: Re: module GC bug
Date: Sat, 9 Jul 2005 21:28:00 +0200

On 7/9/05, Han-Wen Nienhuys <address@hidden> wrote:
> > That would be good, because the current fix (which is already
> > committed to CVS HEAD, and which removes the setting of the
> > procedure-property) still leaves code in modules.c which expects the
> > procedure-property to be set.  If Han-Wen's fix is to be kept, then
> > you should, at least, remove that code. The consequence is that it
> > will no longer be possible to lookup the module of the eval closure
> > for any kind of closures except the standard ones (which are
> > implemented as a smob).
> [...]
> I guess I'm missing something.  Where is the 'module procedure property
> set for other eval closures?

It was set in set-module-eval-closure! before this change:

2005-06-10  Han-Wen Nienhuys  <address@hidden>

        * boot-9.scm (set-module-eval-closure!): remove
        set-procedure-property! closure 'module. Setting this property
        causes un-gc-able modules.

It is read by code in modules.c which (still) looks like this:

scm_lookup_closure_module (SCM proc)
  if (scm_is_false (proc))
    return the_root_module ();
  else if (SCM_EVAL_CLOSURE_P (proc))
    return SCM_PACK (SCM_SMOB_DATA (proc));
      SCM mod = scm_procedure_property (proc, sym_module); <--- HERE
      if (scm_is_false (mod))
        mod = the_root_module ();
      return mod;

Eval closures can be any arbitrary procedure which fulfills the
obligations of an eval closure. This has been used in the guile-tcltk
interface to make Tcl variables and functions look like ordinary
Scheme variables. The SMOB eval closures is an optimization for the
standard case.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]