[squeak-dev] The Inbox: System-cmm.1353.mcz

commits at source.squeak.org commits at source.squeak.org
Tue May 31 22:50:34 UTC 2022


Chris Muller uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-cmm.1353.mcz

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

Name: System-cmm.1353
Author: cmm
Time: 31 May 2022, 5:50:31.586558 pm
UUID: 52f9f789-3ad3-4ec7-914f-85f05ecaaead
Ancestors: System-mt.1352

Added SmalltalkImage>>#heapMemoryLimit to access the -memory or -maxoldspace arguments passed to the vm.

=============== Diff against System-mt.1352 ===============

Item was added:
+ ----- Method: SmalltalkImage>>heapMemoryLimit (in category 'memory space') -----
+ heapMemoryLimit
+ 	"If a memory-limiting argument to the vm was supplied (-memory or -maxoldspace), answer it as an Integer number of bytes, otherwise, nil."
+ 	| foundMemoryArg |
+ 	foundMemoryArg := false.
+ 	Smalltalk optionsDo: 
+ 		[ : each | 
+ 		(#('-memory' '--memory' '-maxoldspace' '--maxoldspace') includes: each)
+ 			ifTrue: [ foundMemoryArg := true ]
+ 			ifFalse: 
+ 				[ foundMemoryArg ifTrue: 
+ 					[ | arg |
+ 					arg := each.
+ 					"The memory arg is expected to be a number that ends in k, m, or g."
+ 					(arg isEmptyOrNil or: [ arg size < 2 ]) ifFalse: 
+ 						[ | requestedMemory |
+ 						requestedMemory := (arg  copyFrom: 1 to: arg size - 1) asNumber.
+ 						requestedMemory > 0 ifTrue: 
+ 							[ ^ requestedMemory * (arg last
+ 								caseOf:
+ 									{ [$k] -> [1000].  [$K] -> [1000].
+ 									[$m] -> [1e6].  [$M] -> [1e6].
+ 									[$g] -> [1e9].  [$G] -> [1e9] }
+ 								otherwise: [^nil]) ] ] ] ] ].
+ 	^ nil!

Item was removed:
- ----- Method: TTFileDescription>>profileAll (in category '*System-Tools-profiling') -----
- profileAll
- 	"Profile reading all the glyphs"
- 	MessageTally spyOn:[
- 		1 to: numGlyphs do:[:glyphIndex| self readGlyphAt: glyphIndex-1].
- 	].!



More information about the Squeak-dev mailing list