Eliot Miranda uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-eem.1415.mcz
==================== Summary ====================
Name: System-eem.1415 Author: eem Time: 6 June 2023, 11:36:51.136681 am UUID: 8e9c1e20-e023-4821-abc3-49779f11630e Ancestors: System-ct.1414
Smalltalk platformName is evaluated in may places, (e.g. even in each event input; see EventSensor>>#processEvent:). It's a slow primitive and does an allocation. So since it doesn't change within a single run, cache it just as endianness is cached. Fix the nilling of the endianness cache to be after running the shutdown list, not before. There's nothing to preclude something in the shutdown list wanting to know endianness and/or platform name info.
=============== Diff against System-ct.1414 ===============
Item was changed: Object subclass: #SmalltalkImage instanceVariableNames: 'globals' + classVariableNames: 'EndianCache LastImageName LastQuitLogPosition LastStats LowSpaceProcess LowSpaceSemaphore MemoryHogs PlatformNameCache ShutDownList SourceFileVersionString StartUpList StartupStamp VMMakerVersion WordSize' - classVariableNames: 'EndianCache LastImageName LastQuitLogPosition LastStats LowSpaceProcess LowSpaceSemaphore MemoryHogs ShutDownList SourceFileVersionString StartUpList StartupStamp VMMakerVersion WordSize' poolDictionaries: '' category: 'System-Support'!
!SmalltalkImage commentStamp: 'dtl 3/6/2010 14:00' prior: 0! I represent the current image and runtime environment, including system organization, the virtual machine, object memory, plugins and source files. My instance variable #globals is a reference to the system dictionary of global variables and class names.
My singleton instance is called Smalltalk.!
Item was changed: ----- Method: SmalltalkImage>>platformName (in category 'os') ----- platformName + "Answer the name of the platform we're running on." - "Return the name of the platform we're running on." "Smalltalk os platformName"
+ ^PlatformNameCache ifNil: [PlatformNameCache := self getSystemAttribute: 1001]! - ^self getSystemAttribute: 1001!
Item was changed: ----- Method: SmalltalkImage>>processShutDownList: (in category 'snapshot and quit') ----- processShutDownList: quitting "Send #shutDown to each class that needs to wrap up before a snapshot. + Also void the various caches; this can't safely be done on start-up because - Also void the endianness chace; this can't safely be done on start-up because Smalltalk is too late in the start-up sequence."
+ self send: #shutDown: toClassesNamedIn: ShutDownList with: quitting. + EndianCache := PlatformNameCache := nil! - EndianCache := nil. - self send: #shutDown: toClassesNamedIn: ShutDownList with: quitting!
packages@lists.squeakfoundation.org