From: "Olivier Andrieu" <oandrieu@gmail.com>
To: "andrew.p.cone" <andrew.p.cone@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Returning caml values from C
Date: Wed, 22 Aug 2007 09:24:37 +0200 [thread overview]
Message-ID: <95513600708220024n247a1068rd9277521ffcb708d@mail.gmail.com> (raw)
In-Reply-To: <12264892.post@talk.nabble.com>
On 8/22/07, andrew.p.cone <andrew.p.cone@gmail.com> wrote:
>
> Hi everybody.
>
> I have a C function that, given a list of caml values, returns a certain
> sublist of those values.
>
> Currently, I have the C code build up a caml list using caml_alloc and
> Store_field. But when I try to access those values in caml, I get a
> segfault.
>
> I suspect the GC is deleting the input list, because it doesn't realize I've
> made something new that refers to some of those values. How do I tell the GC
> that something refers to some value?
by registering the value with the macros CAMLparam* and CAMLlocal*
cf. http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#htoc229
--
Olivier
prev parent reply other threads:[~2007-08-22 7:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-21 22:51 andrew.p.cone
2007-08-22 7:24 ` Olivier Andrieu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=95513600708220024n247a1068rd9277521ffcb708d@mail.gmail.com \
--to=oandrieu@gmail.com \
--cc=andrew.p.cone@gmail.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox