oop, Handle, and hash key
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.
Am 01.03.2010 21:18, schrieb Peng Du:
> 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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-dev