Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Gordon Henriksen <gordonhenriksen@mac.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] c/OCaml interface question... Bigarray
Date: Sat, 5 Apr 2008 17:11:46 -0400	[thread overview]
Message-ID: <95154CE2-1CFC-472C-909C-60A847C457C0@mac.com> (raw)
In-Reply-To: <c6377c1e0804051346n3097b8del196920d8cacdd437@mail.gmail.com>

On 2008-04-05, at 16:46, Andrew I. Schein wrote:

> I have been looking at the Bigarray code to figure out how it  
> works.  I see in the bigarray_get_N function inside  
> bigarray_stubs.c, that there is no use of macro CAMLParam* or  
> CAMLReturn.  How is it that these macros are unnecessary in this code?

These macros allow the garbage collector find and update pointers on  
the stack. Without them, the GC might collect the referenced objects,  
leaving dangling pointers in stack-local variables. The use of these  
macros is unnecessary overhead if (1) the collector cannot be invoked  
from the function (that is, no GC memory is allocated from it) or (2)  
there are no object references kept in parameters or local variables.

— Gordon


      reply	other threads:[~2008-04-05 21:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-05 20:46 Andrew I. Schein
2008-04-05 21:11 ` Gordon Henriksen [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=95154CE2-1CFC-472C-909C-60A847C457C0@mac.com \
    --to=gordonhenriksen@mac.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