Hey folks :wave: I just stumbled upon the fact th...
# kotlin-native
n
Hey folks 👋 I just stumbled upon the fact that
Any?.identityHashCode()
in Native uses object’s memory address only, unlike JVM, where a piece of random data could be used, making
identityHashCode
unique even if two objects happen to be allocated at the same memory address during app’s lifetime. Would it make sense to file this as a bug (it’s a noticeable discrepancy with JVM, after all) or is it a conscious decision to have this implementation in Native?
e
Java does not require that identityHashCode is a random value; some implementations of JVM use memory address (although modern versions of OpenJDK does not, by default)
n
@ephemient thanks for the info