caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Effect of Windows LLP64 architecture on 64 bit MingW OCaml
Date: Fri, 23 Oct 2015 18:13:06 +0200	[thread overview]
Message-ID: <562A5C92.50206@inria.fr> (raw)
In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A172CE32E38@IRSMSX102.ger.corp.intel.com>

On 23/10/15 15:57, Soegtrop, Michael wrote:
> I wonder what differences exist between a 64 bit Linux Ocaml and a 64 bit
> MingW Ocaml. 64bit Windows and MingW64 are what is called LLP64, that is int
> and long are 32 bit and only long long, size_t and pointers are 64 bit as in
> 32 bit Windows. MingW has to follow this convention, otherwise it would be
> incompatible to the Windows headers. But 64 bit Linux tends to be LP64, that
> is int is 32 bit, but long is 64 bit.

That's right.  But the OCaml runtime system abstracts over this
difference, so that you get the same behaviors under Win64 and under
all other 64-bit systems (of the LP64 kind).

> The Ocaml C code doesn’t seem to use
> size abstraction types (like int32, int64)

It does, and even more so in the development version.  The key
abstraction types are "intnat" and "uintnat", designating an integer
type that has the same size as a pointer.  You get those types as
soon as your code includes <caml/mlvalues.h>.

You may have been confused by the use of "long" in the names of the
macros "Val_long" and "Long_val".  Indeed, in the past they used
"long" as "the integer type as big as a pointer type", but since Win64
support was introduced, they actually use type "intnat".

Hope this answers your question.

- Xavier Leroy

  reply	other threads:[~2015-10-23 16:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23 13:57 Soegtrop, Michael
2015-10-23 16:13 ` Xavier Leroy [this message]
2015-10-24  9:29   ` Soegtrop, Michael
2015-10-24 10:05     ` Adrien Nader
2015-10-24 10:09     ` Gabriel Scherer
2015-10-24 10:54       ` Soegtrop, Michael
2015-10-24 10:59     ` David Allsopp
2015-10-26  8:25       ` Soegtrop, Michael
2015-10-24 11:16     ` Gerd Stolpmann
2015-10-26  8:42       ` Soegtrop, Michael
2015-10-26 19:04         ` Adrien Nader
2015-10-24 10:49 Soegtrop, Michael

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=562A5C92.50206@inria.fr \
    --to=xavier.leroy@inria.fr \
    --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).