Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Sylvain Le Gall <sylvain@le-gall.net>
To: caml-list@inria.fr
Subject: [Caml-list] Re: C bindings and Gc.compact
Date: Tue, 5 Apr 2011 12:52:41 +0000 (UTC)	[thread overview]
Message-ID: <slrnipm44p.78h.sylvain@gallu.homelinux.org> (raw)
In-Reply-To: <BANLkTinkeqHDUQRPDtHy6JWghxFimyGVsQ@mail.gmail.com>

Hello,

On 05-04-2011, Pedro Borges <pdhb.lists@gmail.com> wrote:
> Hi, everyone,
>
> If a compactification is triggered do the values get rewritten or do
> they become invalid?
>
>

If the value have been allocated outside the Gc (e.g. malloc-ed), the
pointer is still valid. If it is an OCaml value, it will get rewritten.
But this is already the case with the other Gc stage, and the reason why
you should use CAMLparam/CAMLreturn.

Cheers,
Sylvain Le Gall
-- 
My company: http://www.ocamlcore.com
Linkedin:   http://fr.linkedin.com/in/sylvainlegall
Start an OCaml project here: http://forge.ocamlcore.org
OCaml blogs:                 http://planet.ocamlcore.org



  reply	other threads:[~2011-04-05 12:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-05 11:27 [Caml-list] " Pedro Borges
2011-04-05 12:52 ` Sylvain Le Gall [this message]
2011-04-05 15:03 ` Niki Yoshiuchi

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=slrnipm44p.78h.sylvain@gallu.homelinux.org \
    --to=sylvain@le-gall.net \
    --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