From: Richard Jones <rich@annexia.org>
To: Raj Bandyopadhyay <rajb@rice.edu>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Question about CAMLparamx macros
Date: Thu, 10 Apr 2008 18:48:10 +0100 [thread overview]
Message-ID: <20080410174809.GA16258@annexia.org> (raw)
In-Reply-To: <47FE3E65.7030907@rice.edu>
On Thu, Apr 10, 2008 at 11:20:53AM -0500, Raj Bandyopadhyay wrote:
> I am programming using the OCaml-C interface, and occasionally, my
> program segfaults in the OCaml function 'caml_oldify_local_roots()'
>
> From previous experience, I know that this usually means that I'm not
> using the CAMLparam/CAMLreturn macros correctly somewhere, causing the
> OCaml gc to find NULL pointers.
>
> My question is, when do I have to use or not use these macros? I know I
> need to use these when my C function accepts AND returns OCaml 'value'
> types, but what about the following cases?
It's very instructive to actually look at how these macros are defined
(ie. what code they expand to). There's nothing particularly magical
or complicated about them.
Rich.
--
Richard Jones
Red Hat
next prev parent reply other threads:[~2008-04-10 17:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-10 16:20 Raj Bandyopadhyay
2008-04-10 16:49 ` [Caml-list] " Mathias Kende
2008-04-10 17:48 ` Richard Jones [this message]
2008-04-11 13:42 ` Damien Doligez
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=20080410174809.GA16258@annexia.org \
--to=rich@annexia.org \
--cc=caml-list@yquem.inria.fr \
--cc=rajb@rice.edu \
/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