[MLton-commit] r6371

Vesa Karvonen vesak at mlton.org
Mon Feb 4 05:25:10 PST 2008


Hash ref cells and arrays to constants.  While this may degrade the
performance of some applications, this is the right thing to do.  At some
point it may be possible to hash the identity of ref cells and arrays
recovering performance while maintaining correctness.

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

U   mltonlib/trunk/com/ssh/generic/unstable/detail/value/hash.sml

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

Modified: mltonlib/trunk/com/ssh/generic/unstable/detail/value/hash.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/detail/value/hash.sml	2008-02-01 02:25:48 UTC (rev 6370)
+++ mltonlib/trunk/com/ssh/generic/unstable/detail/value/hash.sml	2008-02-04 13:25:09 UTC (rev 6371)
@@ -118,7 +118,7 @@
 
       fun op --> _ = failing "Hash.--> unsupported"
 
-      fun refc aT = getT aT o Pair.map (!, id)
+      fun refc _ = prim (fn _ => 0wx35996C53)
 
       val int = prim Word.fromInt
 
@@ -146,7 +146,7 @@
             end
       end
 
-      fun array  aT = sequ  ArrayOps.ops (getT aT)
+      fun array _ = prim (fn _ => 0wx6D52A54D)
       fun vector aT = sequ VectorOps.ops (getT aT)
 
       val char = prim (Word.fromInt o ord)




More information about the MLton-commit mailing list