[MLton] Building MLton

John Skaller skaller@users.sourceforge.net
Mon, 04 Jul 2005 19:04:43 +1000

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Mon, 2005-07-04 at 10:09 +0300, Vesa Karvonen wrote:
> Quoting John Skaller <skaller@users.sourceforge.net>:
> > 1. Simple hack -- not good but it may get a result fastest:
> >   use 'unsigned long' instead of 'unsigned int' for a word.
> >   That's the same size as a pointer on gcc/x86-64 at the moment.
> >   Downside: more storage for system 'integer' type.
> I'm not entirely sure what you are after here, but, in C and C++, if you
> want an (unsigned) integer type that is the same size as a pointer, you
> should probably be using the (size_t) ptrdiff_t typedef.

I'm not sure, I think:  ptrdiff_t only has to be big enough to
hold the signed difference between two pointers into
the same object.

So it is perfectly feasible to have 64 bit addresses,
but only 32 bit size_t and ptrdiff_t=20

.. as far as I can glean from the C99 Standard anyhow.

John Skaller <skaller at users dot sourceforge dot net>
Download Felix: http://felix.sf.net

Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

Version: GnuPG v1.2.5 (GNU/Linux)