[squeak-dev] The Inbox: System-dtl.1254.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Nov 26 16:06:22 UTC 2021

A new version of System was added to project The Inbox:

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

Name: System-dtl.1254
Author: dtl
Time: 26 November 2021, 11:06:19.584405 am
UUID: 3856329c-1404-4bd5-9b94-d9c47f663d7c
Ancestors: System-mt.1253

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.

=============== Diff against System-mt.1253 ===============

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