oop, Handle, and hash key

Peng Du imdupeng at gmail.com
Tue Mar 2 09:35:37 PST 2010


Hi, Ulf

Thanks for bring up db4o. I am not familiar with db4o. But it seems to
me a Java application instead of VM. Anyway, I use the identity_hash()
for my idea and it works pretty well. 

Thanks, guys.



On Tue, 2010-03-02 at 10:48 +0100, Ulf Zibis wrote:
> Maybe you can take a look at db4o.
> They track an ID to each object.
> 
> -Ulf
> 
> 
> Am 01.03.2010 21:18, schrieb Peng Du: 
> > Hello, 
> > 
> > I need unique and persistent identifiers to Java objects as keys to a
> > hash table. However, I couldn't find an object_id kind routine. And I am
> > not sure if identity_hash() guarantees uniqueness. So, I figured I can
> > use the address of a Handle of an oop for this purpose, e.g. 
> > 
> > oop o;
> > ...
> > Handle h(o);
> > ...
> > hash.put(h->raw_value(), xx);
> > 
> > 
> > Considering there is no HandleMark around the code, does this work? If
> > yes, would GC reclaim the handle if the associated object (oop) dies? 
> > 
> > 
> > Thanks
> > 
> > 
> > 
> > 
> >   




More information about the hotspot-dev mailing list