[gclist] Re: gclist-digest V2 #91
Urs Hoelzle
urs@cs.ucsb.edu
Wed, 10 Dec 1997 21:41:13 -0800
> Date: Wed, 10 Dec 1997 09:18:44 -0500
> From: David Chase <chase@world.std.com>
> Subject: Re: [gclist] object identity & copying collection
>
> I saw what looked like a clever trick on the Squeak mailing list.
> There, each option header has two bits reserved for storing one of
> three states:
>
> 1. no hash code computed
> 2. hash code is address
> 3. hash code follows object
>
> The usual case is #1. When Object.hashCode is requested, the object
> is placed in state #2. When the object is moved, it is placed in state
> #3.
To give credit where credit is due, I believe this idea is due to Ole
Agesen at SunLabs. As far as I know this neat trick hasn't been
published yet.
-Urs