care for privateClasses in remove
authorClaus Gittinger <cg@exept.de>
Mon, 14 Oct 1996 22:55:55 +0200
changeset 1750 36ff7e62388a
parent 1749 c146bb48d03b
child 1751 0902cadafee2
care for privateClasses in remove
Smalltalk.st
--- a/Smalltalk.st	Mon Oct 14 22:45:12 1996 +0200
+++ b/Smalltalk.st	Mon Oct 14 22:55:55 1996 +0200
@@ -22,7 +22,7 @@
 	category:'System-Support'
 !
 
-!Smalltalk  class methodsFor:'documentation'!
+!Smalltalk class methodsFor:'documentation'!
 
 copyright
 "
@@ -123,7 +123,7 @@
 "
 ! !
 
-!Smalltalk  class methodsFor:'initialization'!
+!Smalltalk class methodsFor:'initialization'!
 
 initGlobalsFromEnvironment
     "setup globals from the shell-environment"
@@ -393,7 +393,7 @@
     Stdout reOpen. Stderr reOpen. Stdin reOpen.
 ! !
 
-!Smalltalk  class methodsFor:'accessing'!
+!Smalltalk class methodsFor:'accessing'!
 
 at:aKey
     "retrieve the value stored under aKey, a symbol. 
@@ -508,7 +508,7 @@
 %}
 ! !
 
-!Smalltalk  class methodsFor:'binary storage'!
+!Smalltalk class methodsFor:'binary storage'!
 
 addGlobalsTo:globalDictionary manager:manager
     |pools|
@@ -547,7 +547,7 @@
     string do:[:char | stream nextPut:char asciiValue]
 ! !
 
-!Smalltalk  class methodsFor:'browsing'!
+!Smalltalk class methodsFor:'browsing'!
 
 browseAllCallsOn:aSelectorSymbol
     "{ Pragma: +optSpace }"
@@ -601,7 +601,7 @@
     "
 ! !
 
-!Smalltalk  class methodsFor:'class management'!
+!Smalltalk class methodsFor:'class management'!
 
 flushCachedClasses
     CachedClasses := nil
@@ -612,7 +612,7 @@
      we have to flush the caches since these methods are now void.
      Also, class variables of aClass are removed."
 
-    |sym cSym names oldName|
+    |sym cSym names oldName privateClasses|
 
     oldName := aClass name.
     sym := oldName asSymbol.
@@ -639,6 +639,19 @@
     "/ self removeKey:sym.     "/ remove key - this actually fails, if there are
                                "/ still compiled code references."
 
+    "remove private classes"
+
+    privateClasses := aClass privateClasses.
+    privateClasses notNil ifTrue:[
+        privateClasses do:[:somePrivateClass |
+            aClass privateClassesAt:(somePrivateClass namePrintString) asSymbol put:nil.
+        ].
+        "/
+        "/ see comment in removeKey: on why we dont remove it here
+        "/
+        "/ self removeKey:cSym
+    ].
+
     "remove class variables"
 
     names := aClass classVariableString asCollectionOfWords.
@@ -651,20 +664,21 @@
         "/
         "/ self removeKey:cSym
     ].
-"
-    actually could get along with less flushing
-    (entries for aClass and subclasses only)
-    but we have to delay this, until we have the set of subclasses
-    at hand - for now, searching for all subclasses is way more
-    expensive then cache flushing.
-
-    aClass allSubclassesDo:[:aSubclass |
-        ObjectMemory flushInlineCachesForClass:aSubclass.
-        ObjectMemory flushMethodCacheFor:aSubclass
-    ].
-    ObjectMemory flushInlineCachesForClass:aClass.
-    ObjectMemory flushMethodCacheFor:aClass
-"
+
+
+"/    actually could get along with less flushing
+"/    (entries for aClass and subclasses only)
+"/    but we have to delay this, until we have the set of subclasses
+"/    at hand - for now, searching for all subclasses is way more
+"/    expensive then cache flushing.
+"/
+"/    aClass allSubclassesDo:[:aSubclass |
+"/        ObjectMemory flushInlineCachesForClass:aSubclass.
+"/        ObjectMemory flushMethodCacheFor:aSubclass
+"/    ].
+"/    ObjectMemory flushInlineCachesForClass:aClass.
+"/    ObjectMemory flushMethodCacheFor:aClass
+
     ObjectMemory flushInlineCaches.
     ObjectMemory flushMethodCache.
 
@@ -673,7 +687,7 @@
 
     aClass category:#'* removed *'.
 
-    "Modified: 10.9.1996 / 20:00:36 / cg"
+    "Modified: 14.10.1996 / 21:54:07 / cg"
 !
 
 renameClass:aClass to:newName
@@ -748,7 +762,7 @@
     "Modified: 4.7.1996 / 11:13:02 / cg"
 ! !
 
-!Smalltalk  class methodsFor:'copying'!
+!Smalltalk class methodsFor:'copying'!
 
 deepCopy
     "redefined to return self - there is only one Smalltalk dictionary"
@@ -782,7 +796,7 @@
     "Modified: 18.5.1996 / 12:13:42 / cg"
 ! !
 
-!Smalltalk  class methodsFor:'debugging ST/X'!
+!Smalltalk class methodsFor:'debugging ST/X'!
 
 debugBreakPoint
     "{ Pragma: +optSpace }"
@@ -912,7 +926,7 @@
 %}
 ! !
 
-!Smalltalk  class methodsFor:'enumerating'!
+!Smalltalk class methodsFor:'enumerating'!
 
 allBehaviorsDo:aBlock
     "evaluate the argument, aBlock for all classes in the system"
@@ -1044,7 +1058,7 @@
 %}
 ! !
 
-!Smalltalk  class methodsFor:'inspecting'!
+!Smalltalk class methodsFor:'inspecting'!
 
 inspectorClass
     "{ Pragma: +optSpace }"
@@ -1055,7 +1069,7 @@
     ^ DictionaryInspectorView
 ! !
 
-!Smalltalk  class methodsFor:'message control'!
+!Smalltalk class methodsFor:'message control'!
 
 silentLoading
     "returns the Silentloading class variable."
@@ -1078,7 +1092,7 @@
     ^ prev
 ! !
 
-!Smalltalk  class methodsFor:'misc stuff'!
+!Smalltalk class methodsFor:'misc stuff'!
 
 addExitBlock:aBlock
     "{ Pragma: +optSpace }"
@@ -1154,7 +1168,7 @@
     OperatingSystem sleep:aDelay
 ! !
 
-!Smalltalk  class methodsFor:'queries'!
+!Smalltalk class methodsFor:'queries'!
 
 allClasses
     "return an unordered collection of all classes in the system.
@@ -1400,7 +1414,7 @@
     "Modified: 7.6.1996 / 08:44:33 / stefan"
 ! !
 
-!Smalltalk  class methodsFor:'startup'!
+!Smalltalk class methodsFor:'startup'!
 
 mainStartup:graphicalMode
     "common start/restart action, if there is a Display, initialize it
@@ -1799,7 +1813,7 @@
     "Modified: 29.7.1996 / 17:04:44 / cg"
 ! !
 
-!Smalltalk  class methodsFor:'startup queries'!
+!Smalltalk class methodsFor:'startup queries'!
 
 commandLine
     "return the full command line arguments (with which ST/X was started)"
@@ -1870,7 +1884,7 @@
     ^ StartupSelector
 ! !
 
-!Smalltalk  class methodsFor:'system environment'!
+!Smalltalk class methodsFor:'system environment'!
 
 language
     "return the language setting"
@@ -1922,7 +1936,7 @@
     "Modified: 26.4.1996 / 17:12:39 / cg"
 ! !
 
-!Smalltalk  class methodsFor:'system management'!
+!Smalltalk class methodsFor:'system management'!
 
 bitmapFileStreamFor:aFileName
     "search aFileName in some standard places;
@@ -3079,7 +3093,7 @@
     "
 ! !
 
-!Smalltalk  class methodsFor:'time-versions'!
+!Smalltalk class methodsFor:'time-versions'!
 
 configuration
     "{ Pragma: +optSpace }"
@@ -3358,8 +3372,8 @@
     "
 ! !
 
-!Smalltalk  class methodsFor:'documentation'!
+!Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.179 1996-10-12 16:32:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.180 1996-10-14 20:55:55 cg Exp $'
 ! !