About FixedIdentitySet

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

About FixedIdentitySet

Nicolas Cellier
I just noticed this:

(FixedIdentitySet withAll: #(a b c)) = #(a a a).

I presume that does not matter...


FixedIdentitySet also make usage of identityHash
- with a basicSize power of two
- using bitAnd: rather than modulo (because of the size being power of
two, that should be equivalent)
I guess it works because used with small size only...
Beware not using scaledIdentityHash then !


Shouldn't the read-only version really use an Array, up to a given
size greater than 0 or 1 ?

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: About FixedIdentitySet

Martin McClure-2
Nicolas Cellier wrote:

> I just noticed this:
>
> (FixedIdentitySet withAll: #(a b c)) = #(a a a).
>
> I presume that does not matter...
>
>
> FixedIdentitySet also make usage of identityHash
> - with a basicSize power of two
> - using bitAnd: rather than modulo (because of the size being power of
> two, that should be equivalent)
> I guess it works because used with small size only...
> Beware not using scaledIdentityHash then !

Yes, I noticed that; FixedIdentitySet was the only class other than
MethodDictionary that needed to use the unscaled primIdentityHash.

I wondered what FixedIdentitySet was used for, it seems like a very odd
beast, but I didn't dig into it.

Regards,

-Martin

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project