[MLton-commit] r7030

Ville Laurikari ville at mlton.org
Sat Apr 4 08:43:03 PST 2009


Fixed GC_physMem() to work with amounts of memory exceeding the width
of 32 bit value.

----------------------------------------------------------------------

U   mlton/trunk/runtime/platform/hpux.c

----------------------------------------------------------------------

Modified: mlton/trunk/runtime/platform/hpux.c
===================================================================
--- mlton/trunk/runtime/platform/hpux.c	2009-04-01 21:22:17 UTC (rev 7029)
+++ mlton/trunk/runtime/platform/hpux.c	2009-04-04 16:43:02 UTC (rev 7030)
@@ -104,10 +104,12 @@
 
 uintmax_t GC_physMem (void) {
         struct pst_static buf;
+        uintmax_t physMem;
 
         if (pstat_getstatic (&buf, sizeof (buf), 1, 0) < 0)
                 diee ("failed to get physical memory size");
-        return buf.physical_memory * buf.page_size;
+        physMem = (uintmax_t)buf.physical_memory * (uintmax_t)buf.page_size;
+        return physMem;
 }
 
 #ifdef __hppa__




More information about the MLton-commit mailing list