oop, Handle, and hash key
Ulf Zibis
Ulf.Zibis at gmx.de
Tue Mar 2 01:48:33 PST 2010
Maybe you can take a look at db4o <www.db4o.com>.
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
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-dev/attachments/20100302/29183491/attachment.html
More information about the hotspot-dev
mailing list