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/parse/parse.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/parse/parse.sml

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

revision 572, Thu Mar 9 02:43:06 2000 UTC revision 573, Thu Mar 9 15:23:52 2000 UTC
# Line 51  Line 51 
51          if SrcPath.compare (p, grouppath) = EQUAL then SOME ig          if SrcPath.compare (p, grouppath) = EQUAL then SOME ig
52          else SrcPathMap.find (!sgc, p)          else SrcPathMap.find (!sgc, p)
53    
54        (* When an entry A vanishes from the stable cache (this only happens in
55         * paranoid mode), then all the other ones that refer to A must
56         * vasish, too.  They might still be valid themselves, but if they
57         * had been unpickled before A became invalid they will point to
58         * invalid data.  By removing them from the cache we force them to
59         * be re-read and re-unpickled.  This restores sanity. *)
60        fun delCachedStable (p, GG.GROUP { grouppath = igp, ... }) = let
61            val changed = ref true
62            fun canStay (GG.GROUP { sublibs, ... }) = let
63                fun goodSublib (p, GG.GROUP { kind = GG.STABLELIB _, ... }) =
64                    SrcPath.compare (p, igp) = EQUAL orelse
65                    SrcPathMap.inDomain (!sgc, p)
66                  | goodSublib _ = true
67                val cs = List.all goodSublib sublibs
68            in
69                if cs then () else changed := true;
70                cs
71            end
72    
73        in
74            (sgc := #1 (SrcPathMap.remove (!sgc, p)))
75                 handle LibBase.NotFound => ();
76            while !changed do
77                 (changed := false; sgc := SrcPathMap.filter canStay (!sgc))
78        end
79    
80      fun listLibs () = map #1 (SrcPathMap.listItemsi (!sgc))      fun listLibs () = map #1 (SrcPathMap.listItemsi (!sgc))
81    
82      fun dropPickles () = let      fun dropPickles () = let
# Line 222  Line 248 
248                                          reg (case try_s () of                                          reg (case try_s () of
249                                                   NONE => SOME g                                                   NONE => SOME g
250                                                 | SOME g' => SOME g')                                                 | SOME g' => SOME g')
251                                      else proc_n (SOME g)                                      else (delCachedStable (group, init_group);
252                                              proc_n (SOME g))
253                              in                              in
254                                  case gopt' of                                  case gopt' of
255                                      NONE => NONE                                      NONE => NONE

Legend:
Removed from v.572  
changed lines
  Added in v.573

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