[squeak-dev] The Trunk: System-dtl.1261.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Dec 1 23:27:06 UTC 2021

David T. Lewis uploaded a new version of System to project The Trunk:

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

Name: System-dtl.1261
Author: dtl
Time: 1 December 2021, 6:27:02.182458 pm
UUID: 9cead45b-ffbd-4606-ab13-fe1180a9c763
Ancestors: System-mt.1260

Let vmParameterAt:ifAbsent: treat nil as an absent parameter. Previously only out of range parameter requests were treated as absent.

Handles the case of parameter 54 which is numeric for Spur VM, nil for Cog VM, and out of range for interpreter VM. Update bytesUsedString to use 0 as default for parameter 54.

(Originally submitted as System-dtl.1254, moved to treated inbox)

=============== Diff against System-mt.1260 ===============

Item was changed:
  ----- Method: SmalltalkImage>>bytesUsedString (in category 'memory space') -----
  	"Answer a string describing the amount of memory in use."
  	"Smalltalk bytesUsedString"
  	| totalUsed |
  	totalUsed := (self vmParameterAt: 2 "used eden + used past space")
+ 				+ ((self vmParameterAt: 1 "old space size")
+ 				- (self vmParameterAt: 54 ifAbsent: 0 "free old space")).
- 				+ ((self vmParameterAt: 1 "old space size") - (self vmParameterAt: 54 "free old space")).
  	^totalUsed asStringWithCommas, ' bytes in use'!

Item was changed:
  ----- Method: SmalltalkImage>>vmParameterAt:ifAbsent: (in category 'vm parameters') -----
  vmParameterAt: parameterIndex ifAbsent: defaultValueOrBlock
+ 	"Answer a VM parameter or defaultValueOrBlock value if out of range
+ 	or if the VM does not provide a value for this parameter. A VM parameter
+ 	is typically numeric or boolean, and if not implemented will be nil."
+ 	^ [(self vmParameterAt: parameterIndex)
+ 			ifNil: defaultValueOrBlock value]
- 	"Answer a VM parameter or defaultValueOrBlock value if out of range."
- 	^ [self vmParameterAt: parameterIndex]
  		on: Error
  		do: [defaultValueOrBlock value]!

More information about the Squeak-dev mailing list