[squeak-dev] The Inbox: Kernel-ael.700.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jul 10 21:36:36 UTC 2012


A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ael.700.mcz

==================== Summary ====================

Name: Kernel-ael.700
Author: ael
Time: 10 July 2012, 2:35:54.223 pm
UUID: 8fff56ba-e690-46f1-aef9-d9b5fe3c9ed8
Ancestors: Kernel-fbs.699

Deliver 'objects pointing to this value' collection as an Array, to avoid the indirection of an OrderedCollection.

=============== Diff against Kernel-fbs.699 ===============

Item was changed:
  ----- Method: Object>>inboundPointersExcluding: (in category 'tracing') -----
  inboundPointersExcluding: objectsToExclude
  "Answer a list of all objects in the system that point to me, excluding those in the collection of objectsToExclude. I do my best to avoid creating any temporary objects that point to myself, especially method and block contexts. Adapted from PointerFinder class >> #pointersTo:except:"
  
  	| anObj pointers objectsToAlwaysExclude |
  	Smalltalk garbageCollect.
  	"big collection shouldn't grow, so it's contents array is always the same"
  	pointers := OrderedCollection new: 1000.
  
  	"#allObjectsDo: and #pointsTo: are expanded inline to keep spurious
  	 method and block contexts out of the results"
  	anObj := self someObject.
  	[0 == anObj] whileFalse: [ "We must use #== here, to avoid leaving the loop when anObj is another number that's equal to 0 (e.g. 0.0)."
  		anObj isInMemory
  			ifTrue: [((anObj instVarsInclude: self)
  				or: [anObj class == self])
  					ifTrue: [pointers add: anObj]].
  		anObj := anObj nextObject].
  
  	objectsToAlwaysExclude := {
  		pointers collector.
  		thisContext.
  		thisContext sender.
  		thisContext sender sender.
  		objectsToExclude.
  	}.
  
+ 	^ (pointers removeAllSuchThat: [:ea |
- 	^ pointers removeAllSuchThat: [:ea |
  		(objectsToAlwaysExclude identityIncludes: ea)
+ 			or: [objectsToExclude identityIncludes: ea]]) asArray!
- 			or: [objectsToExclude identityIncludes: ea]]!



More information about the Squeak-dev mailing list