[MLton-commit] r7526

Matthew Fluet fluet at mlton.org
Fri Apr 15 08:57:35 PDT 2011


Accomodate 32-bit and 64-bit pointers.
----------------------------------------------------------------------

U   mlton/trunk/doc/examples/finalizable/finalizable.sml

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

Modified: mlton/trunk/doc/examples/finalizable/finalizable.sml
===================================================================
--- mlton/trunk/doc/examples/finalizable/finalizable.sml	2011-04-01 22:40:53 UTC (rev 7525)
+++ mlton/trunk/doc/examples/finalizable/finalizable.sml	2011-04-15 15:57:34 UTC (rev 7526)
@@ -8,15 +8,16 @@
    end
 
 functor CList (structure F: MLTON_FINALIZABLE
+               structure P: MLTON_POINTER
                structure Prim:
                   sig
-                     val cons: int * Word32.word -> Word32.word
-                     val free: Word32.word -> unit
-                     val sing: int -> Word32.word
-                     val sum: Word32.word -> int
+                     val cons: int * P.t -> P.t
+                     val free: P.t -> unit
+                     val sing: int -> P.t
+                     val sum: P.t -> int
                   end): CLIST =
    struct
-      type t = Word32.word F.t
+      type t = P.t F.t
 
       fun cons (n: int, l: t) =
          F.withValue
@@ -77,12 +78,13 @@
 
 structure CList =
    CList (structure F = MLton.Finalizable
+          structure P = MLton.Pointer
           structure Prim =
              struct
-                val cons = _import "listCons": int * Word32.word -> Word32.word;
-                val free = _import "listFree": Word32.word -> unit;
-                val sing = _import "listSing": int -> Word32.word;
-                val sum = _import "listSum": Word32.word -> int;
+                val cons = _import "listCons": int * P.t -> P.t;
+                val free = _import "listFree": P.t -> unit;
+                val sing = _import "listSing": int -> P.t;
+                val sum = _import "listSum": P.t -> int;
              end)
 
 structure S = Test (structure CList = CList




More information about the MLton-commit mailing list