WeakIdSet.st
changeset 2102 7a0e81ed345b
parent 2091 c11bb3e29a1b
child 2260 96d898c2874d
equal deleted inserted replaced
2101:516fedf50916 2102:7a0e81ed345b
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
       
    13 'From Smalltalk/X, Version:3.1.3 on 7-jan-1997 at 17:23:23'                     !
       
    14 
    12 
    15 IdentitySet subclass:#WeakIdentitySet
    13 IdentitySet subclass:#WeakIdentitySet
    16 	instanceVariableNames:''
    14 	instanceVariableNames:''
    17 	classVariableNames:''
    15 	classVariableNames:''
    18 	poolDictionaries:''
    16 	poolDictionaries:''
   152     |index "{ Class: SmallInteger }"
   150     |index "{ Class: SmallInteger }"
   153      element|
   151      element|
   154 
   152 
   155     index := 1.
   153     index := 1.
   156     [index <= keyArray size] whileTrue:[
   154     [index <= keyArray size] whileTrue:[
   157 	element := keyArray at:index.
   155         element := keyArray at:index.
   158 	element == 0 ifTrue:[
   156         element == 0 ifFalse:[
   159 	    keyArray at:index put:DeletedEntry.
   157             (element notNil and:[element ~~ DeletedEntry]) ifTrue:[
   160 	] ifFalse:[
   158                 aBlock value:element
   161 	    (element notNil and:[element ~~ DeletedEntry]) ifTrue:[
   159             ]
   162 	        aBlock value:element
   160         ] ifTrue:[
   163 	    ]
   161 
   164 	].
   162 "/ disabled, since we had to lock out interrupts here.
   165 	index := index + 1
   163 "/ The entry is cleared anyway, when the next finalization round
       
   164 "/ is handled.
       
   165 
       
   166 "/            keyArray at:index put:DeletedEntry.
       
   167 "/            tally := tally - 1.
       
   168         ].
       
   169         index := index + 1
   166     ]
   170     ]
   167 ! !
   171 ! !
   168 
   172 
   169 !WeakIdentitySet methodsFor:'private'!
   173 !WeakIdentitySet methodsFor:'private'!
   170 
   174 
   182 ! !
   186 ! !
   183 
   187 
   184 !WeakIdentitySet class methodsFor:'documentation'!
   188 !WeakIdentitySet class methodsFor:'documentation'!
   185 
   189 
   186 version
   190 version
   187     ^ '$Header: /cvs/stx/stx/libbasic/Attic/WeakIdSet.st,v 1.21 1997-01-08 19:42:17 stefan Exp $'
   191     ^ '$Header: /cvs/stx/stx/libbasic/Attic/WeakIdSet.st,v 1.22 1997-01-09 00:32:33 cg Exp $'
   188 ! !
   192 ! !