From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: christophe@raffalli.eu
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Global roots
Date: Mon, 21 Dec 2020 19:37:54 +0100 [thread overview]
Message-ID: <CAH=h3gE16Hypo8+zMns6zLrgYwUj7-jeTNja9TPSb0G8WxE3vQ@mail.gmail.com> (raw)
In-Reply-To: <9AB7B536-D8D5-4473-8692-110F0053F2EE@raffalli.eu>
[-- Attachment #1: Type: text/plain, Size: 964 bytes --]
On Sun, Dec 20, 2020 at 8:57 PM <christophe@raffalli.eu> wrote:
> Hello,
>
> May global roots be initialized to (value)NULL ?
>
Yes, in the default OCaml configuration as of today.
No, in the "no naked pointers" mode that was introduced in OCaml 4.02.0,
made much stricter in OCaml 4.12.0, and will be the default in OCaml 5.0.
To be future-proof and on the safe side, I would suggest to initialize to
e.g. Val_unit.
> I have a multithreaded program, which segfault in callback_asm, while I
> think I respect all rules of c interfaces... Except maybe the above...
>
There is an OPAM compiler switch "4.10.0+nnpcheck" that adds run-time
checks for ill-formed values according to the no-naked-pointers rules.
Maybe you could use it to rule out this potential problem.
Hope this helps,
- Xavier Leroy
> Chevets,
> Christophe
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma
> brièveté.
[-- Attachment #2: Type: text/html, Size: 1677 bytes --]
next prev parent reply other threads:[~2020-12-21 18:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-20 19:56 christophe
2020-12-20 22:22 ` christophe
2020-12-21 18:37 ` Xavier Leroy [this message]
2020-12-21 20:40 ` Christophe Raffalli
2020-12-21 21:03 ` Christophe Raffalli
2020-12-21 22:32 ` ygrek
2020-12-21 23:11 ` Christophe Raffalli
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='CAH=h3gE16Hypo8+zMns6zLrgYwUj7-jeTNja9TPSb0G8WxE3vQ@mail.gmail.com' \
--to=xavier.leroy@inria.fr \
--cc=caml-list@inria.fr \
--cc=christophe@raffalli.eu \
/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