Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.911.mcz
==================== Summary ====================
Name: Collections-eem.911
Author: eem
Time: 14 September 2020, 11:03:02.426231 am
UUID: 28806f32-6ba9-4ef5-b940-571d50d3f942
Ancestors: Collections-eem.910
Correct the redirect logc so that it is the Transcript, and not any old TranscriptStream, that gets redirected to stdout when the redirectToStdOut preference is set Fix a regression in the redefinition of endEntry (forgot to send reset).
=============== Diff against Collections-eem.910 ===============
Item was changed:
----- Method: TranscriptStream>>endEntry (in category 'stream extensions') -----
endEntry
"Display all the characters since the last endEntry, and reset the stream"
self lock critical:
+ [(self == Transcript and: [self class redirectToStdOut])
+ ifTrue:
+ [FileStream stdout nextPutAll: self contents; flush]
+ ifFalse:
+ [self changed: (self class forceUpdate
- [self changed: (self class forceUpdate
ifTrue: [#appendEntry]
+ ifFalse: [#appendEntryLater])].
+ self reset]!
- ifFalse: [#appendEntryLater])]!
Item was removed:
- ----- Method: TranscriptStream>>nextPut: (in category 'stream extensions') -----
- nextPut: anObject
- self target == self ifFalse: [self target nextPut: anObject]. "delegated to stdout"
- ^ super nextPut: anObject.!
Item was removed:
- ----- Method: TranscriptStream>>nextPutAll: (in category 'stream extensions') -----
- nextPutAll: aCollection
- self target == self ifFalse: [self target nextPutAll: aCollection]. "delegated to stdout"
- ^ super nextPutAll: aCollection.!
Item was changed:
----- Method: TranscriptStream>>target (in category 'stream extensions') -----
target
+ ^(self == Transcript and: [self class redirectToStdOut])
-
- ^ self class redirectToStdOut
ifTrue: [FileStream stdout]
ifFalse: [self]!
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.910.mcz
==================== Summary ====================
Name: Collections-eem.910
Author: eem
Time: 14 September 2020, 10:50:35.614055 am
UUID: e9380f4a-daa8-441f-bc2e-a5e6445e4452
Ancestors: Collections-eem.909
Travelling on the one after 909, fix a slip in that last fix.
=============== Diff against Collections-eem.909 ===============
Item was changed:
----- Method: TranscriptStream>>endEntry (in category 'stream extensions') -----
endEntry
"Display all the characters since the last endEntry, and reset the stream"
self lock critical:
[self changed: (self class forceUpdate
ifTrue: [#appendEntry]
+ ifFalse: [#appendEntryLater])]!
- ifFalse: [self changed: #appendEntryLater])]!
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.909.mcz
==================== Summary ====================
Name: Collections-eem.909
Author: eem
Time: 14 September 2020, 10:40:20.674349 am
UUID: de499e36-5394-4102-86f7-aa1def93b595
Ancestors: Collections-mt.908
Make TranscriptStream's access protect an inst var and a Mutex.
=============== Diff against Collections-mt.908 ===============
Item was changed:
WriteStream subclass: #TranscriptStream
+ instanceVariableNames: 'lastChar lock'
+ classVariableNames: 'CharacterLimit ForceUpdate RedirectToStdOut'
- instanceVariableNames: 'lastChar'
- classVariableNames: 'AccessSema CharacterLimit ForceUpdate RedirectToStdOut'
poolDictionaries: ''
category: 'Collections-Streams'!
!TranscriptStream commentStamp: 'fbs 12/30/2013 09:53' prior: 0!
This class is a much simpler implementation of Transcript protocol that supports multiple views and very simple conversion to morphic. Because it inherits from Stream, it is automatically compatible with code that is designed to write to streams.!
Item was changed:
----- Method: TranscriptStream>>endEntry (in category 'stream extensions') -----
endEntry
"Display all the characters since the last endEntry, and reset the stream"
+ self lock critical:
+ [self changed: (self class forceUpdate
+ ifTrue: [#appendEntry]
+ ifFalse: [self changed: #appendEntryLater])]!
- self semaphore critical:[
- self class forceUpdate
- ifTrue: [self changed: #appendEntry]
- ifFalse: [self changed: #appendEntryLater].
- self reset.
- ].!
Item was added:
+ ----- Method: TranscriptStream>>lock (in category 'private') -----
+ lock
+ ^lock ifNil:[lock := Mutex new]!
Item was removed:
- ----- Method: TranscriptStream>>semaphore (in category 'private') -----
- semaphore
- ^AccessSema ifNil:[AccessSema := Semaphore forMutualExclusion]!
Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.908.mcz
==================== Summary ====================
Name: Collections-mt.908
Author: mt
Time: 14 September 2020, 6:27:49.862914 pm
UUID: abfcedd9-2516-7c49-b6e9-714619e50986
Ancestors: Collections-eem.907
Fixes some error messages regarding #become(Forward):.
=============== Diff against Collections-eem.907 ===============
Item was changed:
----- Method: Array>>elementsExchangeIdentityWith: (in category 'converting') -----
elementsExchangeIdentityWith: otherArray
"This primitive performs a bulk mutation, causing all pointers to the elements of the
receiver to be replaced by pointers to the corresponding elements of otherArray.
At the same time, all pointers to the elements of otherArray are replaced by
pointers to the corresponding elements of this array. The identityHashes remain
with the pointers rather than with the objects so that objects in hashed structures
should still be properly indexed after the mutation."
<primitive: 128 error: ec>
ec == #'no modification' ifTrue:
[^self modificationForbiddenFor: otherArray becomeSelector: #elementsExchangeIdentityWith:].
ec == #'bad receiver' ifTrue:
[^self error: 'receiver must be of class Array'].
ec == #'bad argument' ifTrue:
[^self error: (otherArray class == Array
+ ifFalse: ['arg must be of class Array']
+ ifTrue: ['receiver and argument must have the same size'])].
- ifTrue: ['arg must be of class Array']
- ifFalse: ['receiver and argument must have the same size'])].
ec == #'inappropriate operation' ifTrue:
[^self error: 'can''t become immediates such as SmallIntegers or Characters'].
ec == #'object is pinned' ifTrue:
[^self error: 'can''t become pinned objects'].
ec == #'insufficient object memory' ifTrue:
[| maxRequired |
"In Spur, two-way become may involve making each pair of objects into a forwarder into a copy of the other.
So if become fails with #'insufficient object memory', garbage collect, and if necessary, grow memory."
maxRequired := (self detectSum: [:obj | obj class byteSizeOfInstanceOfSize: obj basicSize])
+ (otherArray detectSum: [:obj | obj class byteSizeOfInstanceOfSize: obj basicSize]).
(Smalltalk garbageCollectMost < maxRequired
and: [Smalltalk garbageCollect < maxRequired]) ifTrue:
[Smalltalk growMemoryByAtLeast: maxRequired].
^self elementsExchangeIdentityWith: otherArray].
self primitiveFailed!
Item was changed:
----- Method: Array>>elementsForwardIdentityAndHashTo: (in category 'converting') -----
elementsForwardIdentityAndHashTo: otherArray
"This primitive performs a bulk mutation, causing all pointers to the elements of the
receiver to be replaced by pointers to the corresponding elements of otherArray.
The identityHashes remain with the pointers rather than with the objects so that
the objects in this array should still be properly indexed in any existing hashed
structures after the mutation."
<primitive: 72 error: ec>
ec == #'no modification' ifTrue:
[^self modificationForbiddenFor: otherArray becomeSelector: #elementsForwardIdentityAndHashTo:].
ec == #'bad receiver' ifTrue:
[^self error: 'receiver must be of class Array'].
ec == #'bad argument' ifTrue:
[^self error: (otherArray class == Array
+ ifFalse: ['arg must be of class Array']
+ ifTrue: ['receiver and argument must have the same size'])].
- ifTrue: ['arg must be of class Array']
- ifFalse: ['receiver and argument must have the same size'])].
ec == #'inappropriate operation' ifTrue:
[^self error: 'can''t become immediates such as SmallIntegers or Characters'].
ec == #'object is pinned' ifTrue:
[^self error: 'can''t become pinned objects'].
ec == #'insufficient object memory' ifTrue:
[self error: 'The virtual machine is out-of-date. Please upgrade.'].
self primitiveFailed!
Item was changed:
----- Method: Array>>elementsForwardIdentityTo: (in category 'converting') -----
elementsForwardIdentityTo: otherArray
"This primitive performs a bulk mutation, causing all pointers to the elements of the
receiver to be replaced by pointers to the corresponding elements of otherArray.
The identityHashes are not copied to the target objects so that the objects in otherArray
should still be properly indexed in any existing hashed structures after the mutation."
<primitive: 248 error: ec>
ec == #'no modification' ifTrue:
[^self modificationForbiddenFor: otherArray becomeSelector: #elementsForwardIdentityTo:].
ec == #'bad receiver' ifTrue:
[^self error: 'receiver must be of class Array'].
ec == #'bad argument' ifTrue:
[^self error: (otherArray class == Array
+ ifFalse: ['arg must be of class Array']
+ ifTrue: ['receiver and argument must have the same size'])].
- ifTrue: ['arg must be of class Array']
- ifFalse: ['receiver and argument must have the same size'])].
ec == #'inappropriate operation' ifTrue:
[^self error: 'can''t become immediates such as SmallIntegers or Characters'].
ec == #'object is pinned' ifTrue:
[^self error: 'can''t become pinned objects'].
ec == #'insufficient object memory' ifTrue:
[self error: 'The virtual machine is out-of-date. Please upgrade.'].
self primitiveFailed!
Item was changed:
----- Method: Array>>elementsForwardIdentityTo:copyHash: (in category 'converting') -----
elementsForwardIdentityTo: otherArray copyHash: copyHash
"This primitive performs a bulk mutation, causing all pointers to the elements of the
receiver to be replaced by pointers to the corresponding elements of otherArray.
If copyHash is true, the identityHashes remain with the pointers rather than with the
objects so that the objects in the receiver should still be properly indexed in any
existing hashed structures after the mutation. If copyHash is false, then the hashes
of the objects in otherArray remain unchanged. If you know what you're doing this
may indeed be what you want."
<primitive: 249 error: ec>
ec == #'no modification' ifTrue:
[^self modificationForbiddenFor: otherArray argument: copyHash becomeSelector: #elementsForwardIdentityTo:copyHash:].
ec == #'bad receiver' ifTrue:
[^self error: 'receiver must be of class Array'].
ec == #'bad argument' ifTrue:
[^self error: (otherArray class == Array
+ ifFalse: ['arg must be of class Array']
+ ifTrue: ['receiver and argument must have the same size'])].
- ifTrue: ['arg must be of class Array']
- ifFalse: ['receiver and argument must have the same size'])].
ec == #'inappropriate operation' ifTrue:
[^self error: 'can''t become immediates such as SmallIntegers or Characters'].
ec == #'object is pinned' ifTrue:
[^self error: 'can''t become pinned objects'].
self primitiveFailed!
Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.1339.mcz
==================== Summary ====================
Name: Kernel-ul.1339
Author: ul
Time: 12 September 2020, 1:52:36.827997 pm
UUID: 11d71615-1cc2-4e25-9ac8-d637679f3abd
Ancestors: Kernel-ct.1338
- fixed Context >> #copyTo: which did not stop copying when aContext was reached
- fixed a typo in SmallInteger >> #scaledIdentityHash's comment
=============== Diff against Kernel-ct.1338 ===============
Item was changed:
----- Method: Context>>copyTo: (in category 'query') -----
copyTo: aContext
"Copy self and my sender chain down to, but not including, aContext. End of copied chain will have nil sender. Assume that there is no loop in the context chain."
| currentContext senderContext copy |
self == aContext ifTrue: [ ^nil ].
currentContext := copy := self copy.
[
+ senderContext := currentContext sender ifNil: [ ^copy ].
+ senderContext == aContext ifTrue: [
+ currentContext privSender: nil.
+ ^copy ].
+ senderContext := senderContext copy.
- senderContext := (currentContext sender ifNil: [ ^copy ]) copy.
currentContext privSender: senderContext.
currentContext := senderContext ] repeat!
Item was changed:
----- Method: SmallInteger>>scaledIdentityHash (in category 'comparing') -----
scaledIdentityHash
"For identityHash values returned by primitive 75, answer
+ such values times 2^8. Otherwise, match the existing
- such values times 2^18. Otherwise, match the existing
identityHash implementation"
^self!