# HG changeset patch # User Claus Gittinger # Date 852769953 -3600 # Node ID 7a0e81ed345b56af08e79cc3ef6092180e251368 # Parent 516fedf509162961ccefa01f0227bac32cf4b462 dont clear entries while enumerating diff -r 516fedf50916 -r 7a0e81ed345b WeakIdSet.st --- a/WeakIdSet.st Thu Jan 09 01:31:33 1997 +0100 +++ b/WeakIdSet.st Thu Jan 09 01:32:33 1997 +0100 @@ -10,8 +10,6 @@ hereby transferred. " -'From Smalltalk/X, Version:3.1.3 on 7-jan-1997 at 17:23:23' ! - IdentitySet subclass:#WeakIdentitySet instanceVariableNames:'' classVariableNames:'' @@ -154,15 +152,21 @@ index := 1. [index <= keyArray size] whileTrue:[ - element := keyArray at:index. - element == 0 ifTrue:[ - keyArray at:index put:DeletedEntry. - ] ifFalse:[ - (element notNil and:[element ~~ DeletedEntry]) ifTrue:[ - aBlock value:element - ] - ]. - index := index + 1 + element := keyArray at:index. + element == 0 ifFalse:[ + (element notNil and:[element ~~ DeletedEntry]) ifTrue:[ + aBlock value:element + ] + ] ifTrue:[ + +"/ disabled, since we had to lock out interrupts here. +"/ The entry is cleared anyway, when the next finalization round +"/ is handled. + +"/ keyArray at:index put:DeletedEntry. +"/ tally := tally - 1. + ]. + index := index + 1 ] ! ! @@ -184,5 +188,5 @@ !WeakIdentitySet class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/Attic/WeakIdSet.st,v 1.21 1997-01-08 19:42:17 stefan Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/Attic/WeakIdSet.st,v 1.22 1997-01-09 00:32:33 cg Exp $' ! ! diff -r 516fedf50916 -r 7a0e81ed345b WeakIdentitySet.st --- a/WeakIdentitySet.st Thu Jan 09 01:31:33 1997 +0100 +++ b/WeakIdentitySet.st Thu Jan 09 01:32:33 1997 +0100 @@ -10,8 +10,6 @@ hereby transferred. " -'From Smalltalk/X, Version:3.1.3 on 7-jan-1997 at 17:23:23' ! - IdentitySet subclass:#WeakIdentitySet instanceVariableNames:'' classVariableNames:'' @@ -154,15 +152,21 @@ index := 1. [index <= keyArray size] whileTrue:[ - element := keyArray at:index. - element == 0 ifTrue:[ - keyArray at:index put:DeletedEntry. - ] ifFalse:[ - (element notNil and:[element ~~ DeletedEntry]) ifTrue:[ - aBlock value:element - ] - ]. - index := index + 1 + element := keyArray at:index. + element == 0 ifFalse:[ + (element notNil and:[element ~~ DeletedEntry]) ifTrue:[ + aBlock value:element + ] + ] ifTrue:[ + +"/ disabled, since we had to lock out interrupts here. +"/ The entry is cleared anyway, when the next finalization round +"/ is handled. + +"/ keyArray at:index put:DeletedEntry. +"/ tally := tally - 1. + ]. + index := index + 1 ] ! ! @@ -184,5 +188,5 @@ !WeakIdentitySet class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/WeakIdentitySet.st,v 1.21 1997-01-08 19:42:17 stefan Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/WeakIdentitySet.st,v 1.22 1997-01-09 00:32:33 cg Exp $' ! !