* Re: how to correctly define using scm_define ?
@ 2004-11-02 17:03 Tano Fotang
0 siblings, 0 replies; 3+ messages in thread
From: Tano Fotang @ 2004-11-02 17:03 UTC (permalink / raw)
Thanks. That was the magic (scm_gc_(un)protect).
--- Marius Vollmer <marius.vollmer@uni-dortmund.de> wrote:
...
> You need to 'protect' the SCM value stored into a
> global C variable.
> Otherwise, the garbage collector might not know that
> it is in use and
> will free that SCM value. See
http://www-dt.e-technik.uni-dortmund.de/~mvo/guile.html/Garbage-Collection-Functions.html
...
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 3+ messages in thread
* how to correctly define using scm_define ?
@ 2004-11-02 15:54 Tano Fotang
2004-11-02 16:18 ` Marius Vollmer
0 siblings, 1 reply; 3+ messages in thread
From: Tano Fotang @ 2004-11-02 15:54 UTC (permalink / raw)
I am trying to define some variable (libguile 1.7.1) but it's going the
wrong way all day:
SCM tt;
void set_tt(SCM proc){ //called often to set tt
assert(scm_is_true(scm_procedure_p((proc)))); //passes
scm_define(tt, proc);
assert(scm_is_true(scm_procedure_p((tt)))); //fails
}
So I decide to skip scm_define and just do:
tt = proc;
That appears okay until the following line is seen some minutes later:
scm_apply_0(tt, args)
then this error is displayed:
wrong-type-arg: [apply] Wrong type argument in position 1: #<freed cell
0x406303b0; GC missed a reference>
I'd be glad for any pointers on how to proceed.
/fotang
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-11-02 17:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-02 17:03 how to correctly define using scm_define ? Tano Fotang
-- strict thread matches above, loose matches on Subject: below --
2004-11-02 15:54 Tano Fotang
2004-11-02 16:18 ` Marius Vollmer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).