Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Bob Matcuk <Hamartiology@squeg.net>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] va_arg values
Date: Mon, 15 Jan 2007 18:46:45 -0500	[thread overview]
Message-ID: <200701152238.l0FMclCN013656@concorde.inria.fr> (raw)
In-Reply-To: <20070115104406.GC12311@furbychan.cocan.org>

On Mon, 15 Jan 2007 10:44:07 +0000
Richard Jones <rich@annexia.org> wrote:

> The CAMLparam/CAMLlocal/CAMLreturn/CAMLxparam macros are pretty simple
> to understand.  I suggest you take some simple code using these
> macros, run it through cpp, and have a look at what these macros
> actually generate.  You will be able to make your own (possibly
> non-portable) variations which update caml_local_roots etc. directly.
> If that is necessary.

Indeed. As I said in my original e-mail, I have already written my own
code to do what CAMLparam/CAMLlocal/CAMLxparam do for variable
arguments. Basically, well... Lets start with the quickest question to
answer: is it even necessary?

IF my function is only to be called from other C functions AND if those
functions have already properly registered all of the values via
CAMLparam/CAMLlocal/CAMLxparam (a safe assumption assuming competent
programming) THEN: is it necessary for my function to bother
re-registering these values?

My guess would be no. Generally, it would seem to me that a function
should only have to bother with the
CAMLparam/CAMLlocal/CAMLxparam/CAMLreturn stuff if it makes allocations
via "caml_" functions (malloc and friends would be safe as they have no
hooks into the OCaml GC). Is this true?

--
Bob Matcuk
http://www.Squeg.Net/

Explanation of My Return Address, GPG Key:
http://www.Squeg.Net/returnAddr.php


  reply	other threads:[~2007-01-15 22:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-14  0:18 Bob Matcuk
2007-01-15 10:44 ` [Caml-list] " Richard Jones
2007-01-15 23:46   ` Bob Matcuk [this message]
2007-01-16  4:18 ` Chris King
2007-01-16  7:50   ` Bob Matcuk
2007-01-16 10:47   ` Mattias Engdegård
2007-01-21 17:25 ` Xavier Leroy

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=200701152238.l0FMclCN013656@concorde.inria.fr \
    --to=hamartiology@squeg.net \
    --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