System.identityHashCode() and compacting garbage collectors
Posted
by FredOverflow
on Stack Overflow
See other posts from Stack Overflow
or by FredOverflow
Published on 2010-05-10T07:07:54Z
Indexed on
2010/05/10
7:14 UTC
Read the original article
Hit count: 199
I was just wondering how System.identityHashCode()
is able to always yield the same result for a given object, even if the garbage collector moves it around in memory. Does every object have an additional invisible field storing its identity, independent from its current address?
© Stack Overflow or respective owner