1 class name -> SmallInteger
1 class class name -> SmallIntegerclass
Do not depend on this being true in the future.
Another possible drawback is, that it makes the "become:"
operation slower
in some cases, since instead of a simple pointer exchange, the whole memory
has to be scanned for references in the worst case.
To avoid this, most collection classes have been rewritten to avoid "become:"
,
which makes these less compatible for subclassing.
It is not guaranteed, that this may hold in future versions - an experimental indirect version is planned to measure the speed disadvantage and decide upon these results.
Another possible problem is identityHashing, which cannot be based upon the
pointer (i.e. address of the object table entry) in ST/X.
To support identityHash
, ST/X reserves some bits in the object header which
contains the hash key. Since only 12 bits are currently available, hash-
collisions are to be expected in IdSets/IdDicts with more than 4096 elements.
If you plan to hash heavily on instances of some new class and those hashtables
are going to be (much) bigger than 4k, you can (should)
provide a different identityHash
implementation, which assigns unique
hashKeys (i.e. from a simple counter) to new instances and keep this hashkey in an
instance variable. Redefine identityHash
in that class to return
the value of this instance variable.
I.e. implement:
If you plan to hash heavily on instances of existing system classes,
there is no easy fix, since the field reserved in the object header cannot
easily be made larger.
... subclass:#MyClass
...
instanceVariableNames:'... hashKey ...'
classVariableNames:'NextHashKey'
...
!MyClass class methodsFor:'initialization'!
initialize
NextHashKey := 1
! !
!MyClass methodsFor:'hashing'!
identityHash
hashKey isNil ifTrue:[
hashKey := NextHashKey.
NextHashKey := NextHashKey + 1
].
^ hashKey
!
All view processes are automatically restarted by the system.
Other processes should be restarted in an #update
method of an object
which is a dependent of ObjectMemory. After restart, these dependents
will be notified by ObjectMemory doing a self changed:#restart
.
Copyright © Claus Gittinger Development & Consulting, all rights reserved
(cg@ssw.de)