Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.905.mcz==================== Summary ====================
Name: Collections-eem.905
Author: eem
Time: 31 July 2020, 8:12:16.99079 pm
UUID: 41110ea1-5c9c-40e4-b5fa-156999451cae
Ancestors: Collections-eem.904
Provide SequenceableCollection>>indicesOfSubCollection:[startingAt:]
Add primitiveFetchMourner for ephemerons.
Tidy up restartFinalizationProcess and name the finalization process for the process inspector.
=============== Diff against Collections-eem.904 ===============
Item was added:
+ ----- Method: SequenceableCollection>>indicesOfSubCollection: (in category 'accessing') -----
+ indicesOfSubCollection: subCollection
+ "Answer an Array (possibly empty) of all the indices of subCollection in the receiver."
+
+ ^self indicesOfSubCollection: subCollection startingAt: 1!
Item was added:
+ ----- Method: SequenceableCollection>>indicesOfSubCollection:startingAt: (in category 'accessing') -----
+ indicesOfSubCollection: subCollection startingAt: initialIndex
+ "Answer an Array (possibly empty) of all the indices of subCollection in the receiver starting at
+ initialIndex. N.B. This does not (yet) use Boyer-Moore to skip over unnecessary alignments."
+
+ ^Array streamContents:
+ [:s| | index |
+ index := initialIndex - 1.
+ [(index := self indexOfSubCollection: subCollection startingAt: index + 1) = 0] whileFalse:
+ [s nextPut: index]]!
Item was added:
+ ----- Method: WeakArray class>>primitiveFetchMourner (in category 'private') -----
+ primitiveFetchMourner
+ "Answer the next mourner in the VM's queue of objects to be finalized.
+ The queue contains weak arrays and ephemerons. If the primitive is
+ not implemented, raise an error telling people to upgrade the VM. If
+ implemented, the primitive fails if the queue is empty, with the error
+ code #'not found'. Primitive. Essential."
+
+ <primitive: 172 error: ec>
+ ec ifNil: [^self error: 'The primitiveFetchMourner primitive is missing.\Please upgrade your virtual machine to one that has the primitive.' withCRs].
+ ^nil!
Item was changed:
----- Method: WeakArray class>>restartFinalizationProcess (in category 'private') -----
restartFinalizationProcess
"kill any old process, just in case"
+ FinalizationProcess ifNotNil:
+ [FinalizationProcess terminate.
+ FinalizationProcess := nil].
- FinalizationProcess
- ifNotNil: [FinalizationProcess terminate.
- FinalizationProcess := nil].
FinalizationSemaphore := Smalltalk specialObjectsArray at: 42.
FinalizationDependents ifNil: [FinalizationDependents := WeakArray new: 10].
FinalizationLock := Semaphore forMutualExclusion.
FinalizationProcess := [self finalizationProcess]
+ forkAt: Processor userInterruptPriority + 1
+ named: 'the finalization process'!
- forkAt: Processor userInterruptPriority!