This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Why does the GC frees my function?
- To: Miroslav Silovic <silovic at zesoi dot fer dot hr>
- Subject: Re: Why does the GC frees my function?
- From: Dimitri Ara <dimitri dot ara at mail dot dotcom dot fr>
- Date: 24 Feb 2000 22:53:58 +0100
- Cc: guile at sourceware dot cygnus dot com
- References: <877lfvo5k6.fsf@toto.debian> <7esnyj2bpe.fsf@zesoi.fer.hr>
Miroslav Silovic <silovic@zesoi.fer.hr> a écrit :
> GC doesn't know about alpha binding, so it can't mark SCMs pointed
> from it as used. One way to make it do so is to allocate alpha binding
> as a protected Scheme vector:
>
> SCM *alpha_binding;
>
> void init_alpha_binding
> {
> SCM v = scm_make_vector (SCM_MAKINUM(26), SCM_BOOL_F);
> scm_protect_object (v);
> alpha_binding = SCM_VELTS(v);
> }
Ok. But why it also frees variables i allocate from scheme?
For example i make a hook:
init_hook = scm_make_named_hook ("init", 1);
and i add a function to it:
(add-hook! init
(lambda (str)
(display
(string-append "Welcome to " str ".\n"))))
and then, when i run the hook, guile yalles at me:
ERROR: In procedure string-append:
ERROR: Wrong type argument: #<freed cell 0x401946b8; GC missed a reference>
--
Si la connerie était cotée en bourse,tu serais incarcéré pour
délit d'initié...
-+- EB in: Guide du Cabaliste Usenet - Les initiés ont la cote -+-