MemoryUsageView.st
changeset 7918 cb3b0c5eae80
parent 7860 e160fb58f797
child 7950 c6d71d9c01e3
--- a/MemoryUsageView.st	Mon Jan 07 14:34:51 2008 +0100
+++ b/MemoryUsageView.st	Mon Jan 07 14:54:57 2008 +0100
@@ -226,76 +226,76 @@
     |class inspector|
 
     list selection notNil ifTrue:[
-	class := (info at:(list selection)) at:1.
-	"
-	 special kludge
-	"
-	class isSymbol ifTrue:[^self].
+        class := (info at:(list selection)) at:1.
+        "
+         special kludge
+        "
+        class isSymbol ifTrue:[^self].
 
-	self withCursor:(Cursor questionMark) do:[
-	    |owners dict|
+        self withCursor:(Cursor questionMark) do:[
+            |owners dict|
 
-	    owners := (ObjectMemory whoReferencesInstancesOf:class).
-	    owners isNil ifTrue:[
-		self information:'no owners found - next GC should remove it'.
-		^ self
-	    ].
-	    owners := owners asOrderedCollection.
-	    owners size > 500 ifTrue:[
-		(self confirm:'there are ' , owners size printString , ' owners.\\Do you really want to see them all ?' withCRs)
-		ifFalse:[^ self]
-	    ].
-	    dict := IdentityDictionary new.
-	    owners do:[:owner |
-		|set names oClass s|
+            owners := (ObjectMemory whoReferencesInstancesOf:class).
+            owners isEmptyOrNil ifTrue:[
+                self information:'No owners found - next GC should remove it'.
+                ^ self
+            ].
+            owners := owners asOrderedCollection.
+            owners size > 500 ifTrue:[
+                (self confirm:'there are ' , owners size printString , ' owners.\\Do you really want to see them all ?' withCRs)
+                ifFalse:[^ self]
+            ].
+            dict := IdentityDictionary new.
+            owners do:[:owner |
+                |set names oClass s|
 
-		"
-		 skip weakArrays ... (they dont count)
-		"
-		(owner isMemberOf:WeakArray) ifFalse:[
-		    set := Set new.
-		    owner == Smalltalk ifTrue:[
-			owner keysAndValuesDo:[:key :val |
-			    (val isMemberOf:class) ifTrue:[
-				set add:key
-			    ]
-			]
-		    ] ifFalse:[
-			names := owner class allInstVarNames.
-			oClass := owner class.
-			1 to:oClass instSize do:[:i |
-			    ((owner instVarAt:i) isMemberOf:class) ifTrue:[
-				set add:(names at:i).
-			    ].
-			].
-			oClass isVariable ifTrue:[
-			    oClass isPointers ifTrue:[
-				1 to:owner basicSize do:[:i |
-				    ((owner basicAt:i) isMemberOf:class) ifTrue:[
-					set add:i
-				    ]
-				]
-			    ]
-			].
-		    ].
-		    "
-		     put a describing string into the dictionary
-		    "
-		    s := 'references in: '.
-		    set do:[:name | 
-				name isString ifTrue:[
-				    s := s , name , ' '
-				] ifFalse:[
-				    s := s , '[' , name printString , '] '
-				]
-			   ].
-		    dict at:owner put:s.
+                "
+                 skip weakArrays ... (they dont count)
+                "
+                (owner isMemberOf:WeakArray) ifFalse:[
+                    set := Set new.
+                    owner == Smalltalk ifTrue:[
+                        owner keysAndValuesDo:[:key :val |
+                            (val isMemberOf:class) ifTrue:[
+                                set add:key
+                            ]
+                        ]
+                    ] ifFalse:[
+                        names := owner class allInstVarNames.
+                        oClass := owner class.
+                        1 to:oClass instSize do:[:i |
+                            ((owner instVarAt:i) isMemberOf:class) ifTrue:[
+                                set add:(names at:i).
+                            ].
+                        ].
+                        oClass isVariable ifTrue:[
+                            oClass isPointers ifTrue:[
+                                1 to:owner basicSize do:[:i |
+                                    ((owner basicAt:i) isMemberOf:class) ifTrue:[
+                                        set add:i
+                                    ]
+                                ]
+                            ]
+                        ].
+                    ].
+                    "
+                     put a describing string into the dictionary
+                    "
+                    s := 'references in: '.
+                    set do:[:name | 
+                                name isString ifTrue:[
+                                    s := s , name , ' '
+                                ] ifFalse:[
+                                    s := s , '[' , name printString , '] '
+                                ]
+                           ].
+                    dict at:owner put:s.
 "/                            dict at:owner put:set
-		]
-	    ].
-	    inspector := DictionaryInspectorView openOn:dict.
-	    inspector listView doubleClickAction:[:lineNr | inspector doInspectKey].
-	]
+                ]
+            ].
+            inspector := DictionaryInspectorView openOn:dict.
+            inspector listView doubleClickAction:[:lineNr | inspector doInspectKey].
+        ]
     ]
 
     "Modified: 15.10.1996 / 22:09:38 / cg"
@@ -656,5 +656,5 @@
 !MemoryUsageView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/MemoryUsageView.st,v 1.48 2007-10-11 12:47:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/MemoryUsageView.st,v 1.49 2008-01-07 13:54:57 cg Exp $'
 ! !