[squeak-dev] true hash

Bert Freudenberg bert at freudenbergs.de
Wed May 9 19:57:16 UTC 2012


On 09.05.2012, at 21:28, Chris Muller wrote:

> Where do true, false and nil obtain their hash value?  They inherit
> #hash from Object, so it is their identityHash, but I noticed this is
> consistent between images -- how?  It's great, but is there any danger
> of that value ever changing?  That would be bad..


The identity hash bits are stored in each object's header. And since true, false, nil are the same decades old instances, their hash did not change.

Depending on what the SystemTracer does, it may be different in an image derived by that though. E.g. you may want to check a 64 bit image.

- Bert -



More information about the Squeak-dev mailing list