caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Alexey Egorov" <electreg@list.ru>
To: caml-list <caml-list@inria.fr>
Subject: [Caml-list] Some questions regarding OCaml FFI
Date: Mon, 03 Apr 2017 01:58:42 +0300	[thread overview]
Message-ID: <1491173922.446722065@f400.i.mail.ru> (raw)

Hello,

I have some questions about OCaml FFI:

1) Should I declare local variable with CAMLlocalN if its used "temporarily", for example:
CAMLreturn(Val_long(1));
vs
CAMLlocal1(longval);
longval = Val_long(1);
CAMLreturn(longval);

2) Should I call 'caml_acquire_runtime_system()' prior to calling OCaml functions from C main()? If so - should I call it before or after 'caml_startup()'?

Thanks!

             reply	other threads:[~2017-04-02 22:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-02 22:58 Alexey Egorov [this message]
2017-04-03 15:35 ` Gerd Stolpmann

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=1491173922.446722065@f400.i.mail.ru \
    --to=electreg@list.ru \
    --cc=caml-list@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;
as well as URLs for NNTP newsgroup(s).