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/cm/stable/stabilize.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/stable/stabilize.sml

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

revision 304, Mon May 31 09:10:08 1999 UTC revision 305, Mon May 31 15:00:06 1999 UTC
# Line 25  Line 25 
25                           val compare = compare                           val compare = compare
26          end)          end)
27    
28      structure SmlInfoSet =      fun f (g as GroupGraph.GROUP { exports, ... }, binSizeOf, binCopy) = let
         BinarySetFn (struct  
                          type ord_key = SmlInfo.info  
                          val compare = SmlInfo.compare  
         end)  
   
     fun f (GroupGraph.GROUP { exports, ... }, binSizeOf, binCopy) = let  
29          (* The format of a stable archive is the following:          (* The format of a stable archive is the following:
30           *  - It starts with the size s of the pickled dependency graph.           *  - It starts with the size s of the pickled dependency graph.
31           *    This size itself is written as four-byte string.           *    This size itself is written as four-byte string.
# Line 55  Line 49 
49          end          end
50    
51          val offsetDict = let          val offsetDict = let
52              fun add (i, (d, n)) = let              fun add (i, (d, n)) =
53                  val spec = AbsPath.spec (SmlInfo.sourcepath i)                  (SmlInfoMap.insert (d, i, n), n + binSizeOf i)
54              in              in
55                  (StringMap.insert (d, spec, n), n + binSizeOf i)              #1 (foldl add (SmlInfoMap.empty, 0) members)
             end  
         in  
             #1 (foldl add (StringMap.empty, 0) members)  
56          end          end
57    
58          fun w_list w_item [] k m = ";" :: k m          fun w_list w_item [] k m = ";" :: k m
# Line 114  Line 105 
105            | w_sharing (SOME false) k m = "f" :: k m            | w_sharing (SOME false) k m = "f" :: k m
106    
107          fun w_si_raw i k = let          fun w_si_raw i k = let
108              val spec = AbsPath.pickleSpec (SmlInfo.sourcepath i)              val spec = AbsPath.spec (SmlInfo.sourcepath i)
109              val offset = valOf (StringMap.find (offsetDict, spec))              val offset = valOf (SmlInfoMap.find (offsetDict, i))
110          in          in
111              w_string spec (w_int offset (w_sharing (SmlInfo.share i) k))              w_string spec (w_int offset (w_sharing (SmlInfo.share i) k))
112          end          end
# Line 124  Line 115 
115    
116          fun w_primitive p k m = String.str (Primitive.toIdent p) :: k m          fun w_primitive p k m = String.str (Primitive.toIdent p) :: k m
117    
118          fun w_abspath_raw p k m = w_string (AbsPath.pickle p) k m          fun w_abspath_raw p k m = w_list w_string (AbsPath.pickle p) k m
119    
120          val w_abspath = w_share w_abspath_raw AP          val w_abspath = w_share w_abspath_raw AP
121    
# Line 144  Line 135 
135    
136          and w_fsbn (f, n) k = w_filter f (w_sbn n k)          and w_fsbn (f, n) k = w_filter f (w_sbn n k)
137    
138          fun w_impexp (n, _) k = w_fsbn n k          fun w_impexp (s, (n, _)) k = w_symbol s (w_fsbn n k)
139    
140            fun w_exports e = w_list w_impexp (SymbolMap.listItemsi e)
141    
142            fun w_bool true k m = "t" :: k m
143              | w_bool false k m = "f" :: k m
144    
145            fun w_privileges p = w_list w_string (StringSet.listItems p)
146    
147            fun pickle_group (GroupGraph.GROUP g) = let
148                val { exports, islib, required, grouppath, subgroups, ... } = g
149                fun w_sg (GroupGraph.GROUP { grouppath = gp, ... }) = w_abspath gp
150                fun k0 m = []
151                val m0 = (0, Map.empty)
152            in
153                concat
154                  (w_exports exports
155                       (w_bool islib
156                              (w_privileges required
157                                       (w_abspath grouppath
158                                                  (w_list w_sg subgroups k0)))) m0)
159            end
160            val pickle = pickle_group g
161            val sz = size pickle
162      in      in
163          ()          ()
164      end      end

Legend:
Removed from v.304  
changed lines
  Added in v.305

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