[MLton] Re: [MLton-commit] r5742

Matthew Fluet fluet at tti-c.org
Sun Jul 8 14:23:42 PDT 2007


On Sun, 8 Jul 2007, jlouis at mlton.org wrote:
> Plug a 32/64 problem on LP64 by using a size_t correctly when doing syscalls.
>
> ----------------------------------------------------------------------
>
> U   mlton/trunk/runtime/platform/sysctl.c
>
> ----------------------------------------------------------------------
>
> Modified: mlton/trunk/runtime/platform/sysctl.c
> ===================================================================
> --- mlton/trunk/runtime/platform/sysctl.c	2007-07-08 20:21:10 UTC (rev 5741)
> +++ mlton/trunk/runtime/platform/sysctl.c	2007-07-08 20:21:12 UTC (rev 5742)
> @@ -12,7 +12,7 @@
> }
>
> size_t GC_totalRam (void) {
> -  int physMem;
> +  size_t physMem;
>   size_t len;
>   int mib[2];

Is the HW_PAGESIZE sysctl also a size_t?  The FreeBSD sysctl man page 
just says that the type is "integer".

Also, the NetBSD man page seems to suggest that a separate physmem64 
control is used to fetch the size of RAM, while physmem is guaranteed to 
be 32-bits:
   http://netbsd.gw.com/cgi-bin/man-cgi?sysctl+7+NetBSD-current



More information about the MLton mailing list