unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* A question about scm_guard()
@ 2005-12-06 15:46 Rients van Wijngaarden
  2005-12-08  0:56 ` Kevin Ryde
  0 siblings, 1 reply; 2+ messages in thread
From: Rients van Wijngaarden @ 2005-12-06 15:46 UTC (permalink / raw)


Hi,

I'm using guile in combination with C++ and I'm having some trouble with
garbage collection. Now I'm trying to use guards, to circumvent GC.

To make a guardian, I use 'scm_make_guardian([name of the guardian]);' and
all is fine.
The next step is to actually guard some objects, so I try to use:
'scm_guard([name of the guardian], [object to be guarded]);'

according to some sources this should work, but I get a compiling error:
"too few arguments to function `scm_unused_struct*
scm_guard(scm_unused_struct*, scm_unused_struct*, int)'"

so obviously, scm_guard needs a third argument of type int, but my
question is:
What is this int?

I hope somebody can help me...

Rients (the Netherlands)



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: A question about scm_guard()
  2005-12-06 15:46 A question about scm_guard() Rients van Wijngaarden
@ 2005-12-08  0:56 ` Kevin Ryde
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Ryde @ 2005-12-08  0:56 UTC (permalink / raw)
  Cc: guile-user

"Rients van Wijngaarden" <Rients.vanWijngaarden@phil.uu.nl> writes:
>
> so obviously, scm_guard needs a third argument of type int, but my
> question is:
> What is this int?

Hmm.  A flag saying whether you want an error thrown if the object is
already guarded.

Apparently scm_guard is going to be deprecated in the next release, in
favour of

	scm_call_1 (GUARDIAN, OBJECT)

the same as would be done from scheme code.  I think that would work
in 1.6 too (without trying it :-).


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-12-08  0:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-06 15:46 A question about scm_guard() Rients van Wijngaarden
2005-12-08  0:56 ` Kevin Ryde

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).