Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/compiler/Semant/pickle/rehash.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/Semant/pickle/rehash.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1136, Tue Mar 12 19:44:02 2002 UTC revision 1137, Tue Mar 12 22:28:55 2002 UTC
# Line 10  Line 10 
10   * produced had the smaller environment been pickled (and hashed) in   * produced had the smaller environment been pickled (and hashed) in
11   * the first place. *)   * the first place. *)
12  structure Rehash : sig  structure Rehash : sig
13      val addPepper : { hash: PersStamps.persstamp, pepper: string }      val addGUID : { hash: PersStamps.persstamp, guid: string }
14                      -> PersStamps.persstamp                      -> PersStamps.persstamp
15      val rehash : { env: StaticEnv.staticEnv,      val rehash : { env: StaticEnv.staticEnv,
16                     orig_pid: PersStamps.persstamp,                     orig_pid: PersStamps.persstamp,
17                     pepper: string }                     guid: string }
18                   -> PersStamps.persstamp                   -> PersStamps.persstamp
19  end = struct  end = struct
20      fun addPepper { hash, pepper } = let      fun addGUID { hash, guid } = let
21          val crc = CRC.fromString (Byte.bytesToString (PersStamps.toBytes hash))          val crc = CRC.fromString (Byte.bytesToString (PersStamps.toBytes hash))
22          fun append (c, x) = CRC.append (x, c)          fun append (c, x) = CRC.append (x, c)
23          val crc' = CharVector.foldl append crc pepper          val crc' = CharVector.foldl append crc guid
24      in      in
25          PersStamps.fromBytes (Byte.stringToBytes (CRC.toString crc'))          PersStamps.fromBytes (Byte.stringToBytes (CRC.toString crc'))
26      end      end
27    
28      fun rehash { env, orig_pid, pepper } =      fun rehash { env, orig_pid, guid } =
29          addPepper { hash = #hash (PickMod.pickleEnv          addGUID { hash = #hash (PickMod.pickleEnv
30                                        (PickMod.REHASH orig_pid)                                      (PickMod.REHASH orig_pid) env),
31                                        env),                    guid = guid }
                     pepper = pepper }  
32  end  end

Legend:
Removed from v.1136  
changed lines
  Added in v.1137

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0