[Pkg] The Trunk: Collections-eem.676.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jan 5 20:38:29 UTC 2016

Eliot Miranda uploaded a new version of Collections to project The Trunk:

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

Name: Collections-eem.676
Author: eem
Time: 5 January 2016, 12:38:09.288345 pm
UUID: e3bea3a9-1d66-4cae-b3e3-5ed8e46d3194
Ancestors: Collections-cmm.675

Handle out-of-memory failure of elementsForwardIdentityTo:.

=============== Diff against Collections-cmm.675 ===============

Item was changed:
  ----- Method: Array>>elementsForwardIdentityTo: (in category 'converting') -----
  elementsForwardIdentityTo: otherArray
  	"This primitive performs a bulk mutation, causing all pointers to the elements of the
  	 receiver to be replaced by pointers to the corresponding elements of otherArray.
  	 The identityHashes remain with the pointers rather than with the objects so that
  	 the objects in this array should still be properly indexed in any existing hashed
  	 structures after the mutation."
  	<primitive: 72 error: ec>
+ 	ec == #'bad receiver' ifTrue:
+ 		[^self error: 'receiver must be of class Array'].
+ 	ec == #'bad argument' ifTrue:
+ 		[^self error: (otherArray class == Array
+ 						ifTrue: ['arg must be of class Array']
+ 						ifFalse: ['receiver and argument must have the same size'])].
+ 	ec == #'inappropriate operation' ifTrue:
+ 		[^self error: 'can''t become immediates such as SmallIntegers or Characters'].
+ 	ec == #'no modification' ifTrue:
+ 		[^self error: 'can''t become immutable objects'].
+ 	ec == #'object is pinned' ifTrue:
+ 		[^self error: 'can''t become pinned objects'].
+ 	ec == #'insufficient object memory' ifTrue:
+ 		[Smalltalk garbageCollect < 1048576 ifTrue:
+ 			[Smalltalk growMemoryByAtLeast: 1048576].
+ 		 ^self elementsForwardIdentityTo: otherArray].
  	self primitiveFailed!

More information about the Packages mailing list