This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Re: The taming of the before-gc-hook (was Re: Upcoming 1.3.2 release)
hjstein@bfr.co.il (Harvey J. Stein) writes:
> If the evaluator doesn't do any consing then the same scheme fcns are
> as safe from Scheme as they are from C.
Actually, the evaluator normally does a lot of consing when evaluating
Scheme code (primarily when creating environment frames and building
argument lists).
But run-hooks doesn't cons anything if the hooks are a list of subrs.
Of course, consing can happen also if the before-gc-hook is
implemented with a new purely C mechanism (if the code calls any of a
certain subset of functions in the gh and scm interfaces).
So, it's the very idea of a before-gc-hook which could be considered a
bit unclean.
On the other hand, it is very useful.
So, having the scm_before_gc_hook/scm_after_gc_hook from C, and
after-gc-hook from Scheme is probably a good idea.