[Pkg] The Trunk: System-mt.1354.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Jun 2 14:49:55 UTC 2022
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1354.mcz
==================== Summary ====================
Name: System-mt.1354
Author: mt
Time: 2 June 2022, 4:49:50.191188 pm
UUID: 385b6eb3-474e-1a42-920c-f6ab09d67baa
Ancestors: System-ct.1353, System-cmm.1353
Merge System-cmm.1353 in preparetion of fixing that exteme allocation test.
=============== Diff against System-ct.1353 ===============
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!
More information about the Packages
mailing list