[squeak-dev] Re: SystemEditor
Andreas Raab
andreas.raab at gmx.de
Thu Nov 27 03:45:14 UTC 2008
Okay, I'm slowly getting there. It seems like updating SystemEditor in
MC in 3.10 somehow broke it - some methods were simply referring to the
wrong ivars which caused SE not to work at all. Recompiling the SE
packages fixed that.
Secondly, the issue I was seeing with the iVars being incorrect are one
of the subtleties that SE currently doesn't correctly deal with. Here is
an illustration:
testCleanupOfOldInstances
"Ensure that old instance are cleaned up properly"
instance := CleanupTestClass new.
Smalltalk garbageCollect. "for easier results make it old"
self assert: CleanupTestClass instanceCount = 1.
ed := SystemEditor new.
(ed at: #CleanupTestClass) addInstVarName: #whatever.
ed commit.
self assert: CleanupTestClass instanceCount = 1.
ed := SystemEditor new.
(ed at: #CleanupTestClass) removeInstVarName: #whatever.
ed commit.
self assert: CleanupTestClass instanceCount = 1.
The problem is that since #become: changes class pointers you *must*
clean out the old instances or otherwise they'll be completely and
utterly broken when you finally #become: the classes itself. This can be
achieved by placing a strategic full GC in the right place in the
migration process (I'm not sure where that would be in SE but probably
somewhere in the migration transaction).
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|