From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id C4AE3BB91 for ; Sat, 23 Jul 2005 14:14:50 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6NCEn7c010863 for ; Sat, 23 Jul 2005 14:14:49 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA11948 for ; Sat, 23 Jul 2005 14:14:49 +0200 (MET DST) Received: from mallaury.nerim.net (smtp-106-saturday.noc.nerim.net [62.4.17.106]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6NCEmk6010858 for ; Sat, 23 Jul 2005 14:14:48 +0200 Received: from [192.168.1.2] (xleroy.net1.nerim.net [62.212.116.147]) by mallaury.nerim.net (Postfix) with ESMTP id 468B34F3B1; Sat, 23 Jul 2005 14:14:40 +0200 (CEST) Message-ID: <42E234B7.3070608@inria.fr> Date: Sat, 23 Jul 2005 14:14:47 +0200 From: Xavier Leroy User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: malc Cc: Jacques Garrigue , roessler@rftp.com, caml-list@inria.fr Subject: Re: [Caml-list] A pair of "Interfacing with C" questions References: <42DF2A64.4000600@rftp.com> <20050721.192154.31710299.garrigue@math.nagoya-u.ac.jp> In-Reply-To: X-Enigmail-Version: 0.91.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 42E234B9.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42E234B8.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 interfacing:01 mlvalues:01 nativeint:01 pointer:01 sizeof:01 sizeof:01 ocaml:01 nativeint:01 ocaml:01 integers:01 pointer:01 ...:98 pair:01 define:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 >> If you look at mlvalues.h you will see that nativeint is define as >> long int. So this should be the natural format for a pointer. > > > I don't think so, Win64 ABI has sizeof(long) == 4 and sizeof(void *) == 8. ... which is why a port of OCaml to Win64 would use long long (or, better, intptr_t, if available) for the C type "value" and the Caml type "nativeint". In other terms, OCaml values are integers big enough to hold a pointer, and the type nativeint has (by construction) the same size as a value. - Xavier Leroy