When using BigInteger.fromByteArray from native multiplatform code (iOS specifically) I came upon the error IncorrectDereferenceException: Trying to access top level value not marked as @ThreadLocal or @SharedImmutable from non-main thread. The stack trace ultimately points to
internal val chosenArithmetic: BigIntegerArithmetic =
BigInteger63Arithmetic
in Configuration.kt
It may be as simple as adding the @SharedImmutable annotation to that top level value (at a quick glance it does look like BigInteger63Arithmetic is immutable). I haven't been able to try that out yet though.
When using
BigInteger.fromByteArray
from native multiplatform code (iOS specifically) I came upon the errorIncorrectDereferenceException: Trying to access top level value not marked as @ThreadLocal or @SharedImmutable from non-main thread
. The stack trace ultimately points toin
Configuration.kt
It may be as simple as adding the
@SharedImmutable
annotation to that top level value (at a quick glance it does look likeBigInteger63Arithmetic
is immutable). I haven't been able to try that out yet though.