|Anonymous | Login||10-18-2021 03:26 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details [ Jump to Notes ]||[ View Advanced ] [ Issue History ] [ Print ]|
|ID||Category||Severity||Reproducibility||Date Submitted||Last Update|
|0001020||[Squeak Packages] WriteBarrier||minor||always||03-30-05 01:46||03-30-05 01:46|
|Summary||0001020: [BUG][FIX] WriteBarrier at:put: fix for variable classes|
Chris Muller <firstname.lastname@example.org> writes:
"The WriteBarrier class-comment states:
- any methods that potentially modify instance variables will be overriden in
this new class. The overridden method stores the original values of the
instance variable in temps, then calls the super method, and then compares the
current inst var values with the originals.
- If the instance variable values have changed, the WriteBarrier will be
notified with a send to #modified:, with the object that was modified as the
- For variably-sized classes, #at:put: is also overridden to provide the same
While integrating WriteBarrier into Magma, I noticed my Array test was actually
slower than without WriteBarrier. The problem is in
WBClassBuilder>>installAtPutOverrides, which do not check whether the value is
changed, it signals #modified no matter what.
To demonstrate this:
| a wb |
a _ Array with: true.
wb _ DirtySetWriteBarrier new.
wb add: a.
a at: 1 put: true.
wb dirtySet includes: a
This script should return false. After loading the attached fix, it will.
Also, I have a question. Are there any caveats to overriding instVarAt:put: to
check for a new value as well? The same class-comment says:
- The WriteBarrier is semi-permeable: if you want to modify an object directly
without triggering notifications, you can use #instVarAt:put: and
This reduces transparency albeit just a little; and this same permeability
could be achieved by temporarily removing from the WriteBarrier. Is there any
reason not to do it?"
|Attached Files||WriteBarrierAtPutOverrideFix.1.cs.gz [^] (329 bytes) 03-30-05 01:46|
|There are no notes attached to this issue.|
|03-30-05 01:46||KenCausey||New Issue|
|03-30-05 01:46||KenCausey||File Added: WriteBarrierAtPutOverrideFix.1.cs.gz|
| Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
29 total queries executed.|
24 unique queries executed.