diff --git a/kotlinx-coroutines-core/native/src/Debug.kt b/kotlinx-coroutines-core/native/src/Debug.kt index a0a8d272f8..f17c2ed7fc 100644 --- a/kotlinx-coroutines-core/native/src/Debug.kt +++ b/kotlinx-coroutines-core/native/src/Debug.kt @@ -5,14 +5,12 @@ package kotlinx.coroutines import kotlin.math.* +import kotlin.native.* internal actual val DEBUG: Boolean = false -internal actual val Any.hexAddress: String get() = abs(id().let { if (it == Int.MIN_VALUE) 0 else it }).toString(16) +internal actual val Any.hexAddress: String get() = identityHashCode().toUInt().toString(16) internal actual val Any.classSimpleName: String get() = this::class.simpleName ?: "Unknown" -@SymbolName("Kotlin_Any_hashCode") -public external fun Any.id(): Int // Note: can return negative value on K/N - internal actual inline fun assert(value: () -> Boolean) {}