[Pkg] The Trunk: System-eem.1359.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jun 10 23:32:49 UTC 2022


Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1359.mcz

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

Name: System-eem.1359
Author: eem
Time: 10 June 2022, 4:32:43.464831 pm
UUID: 3485074c-6683-47b8-a79b-6a3723cbc7a0
Ancestors: System-eem.1358

Implement heapMemoryLimit correctly.

=============== Diff against System-eem.1358 ===============

Item was changed:
  ----- Method: SmalltalkImage>>heapMemoryLimit (in category 'memory space') -----
  heapMemoryLimit
+ 	"If an old space memory-limit is in effect, answer it as an Integer number of bytes, otherwise, nil."
+ 	| vmLimit |
+ 	vmLimit := Smalltalk parameterAt: 67.
+ 	^vmLimit isZero ifFalse: [vmLimit]!
- 	"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!



More information about the Packages mailing list