martmists
07/12/2021, 9:04 AMUncaught Kotlin exception: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlin.collections.ArrayList@1aa3f68
at kfun:kotlin.Throwable#<init>(kotlin.String?){} (0x4169a9)
at kfun:kotlin.Exception#<init>(kotlin.String?){} (0x410c87)
at kfun:kotlin.RuntimeException#<init>(kotlin.String?){} (0x410d97)
at kfun:kotlin.native.concurrent.InvalidMutabilityException#<init>(kotlin.String){} (0x433557)
at ThrowInvalidMutabilityException (0x434a76)
at Kotlin_AtomicReference_checkIfFrozen (0x523c71)
at kfun:kotlin.native.concurrent.AtomicReference#<init>(1:0){} (0x4328ae)
at ...
KamilH
07/12/2021, 10:53 AMStately
library and its collections implementation:
https://github.com/touchlab/Stately#stately-iso-collectionsDominaezzz
07/12/2021, 11:02 AMmartmists
07/12/2021, 11:09 AMmartmists
07/12/2021, 11:09 AMmartmists
07/12/2021, 11:10 AMDominaezzz
07/12/2021, 11:12 AMmartmists
07/12/2021, 11:15 AMopen class IIRNode<T>(coeffsA: List<Float>, coeffsB: List<Float>) : MonoNode<T>() {
private val coeffsA = AtomicReference(coeffsA)
private val coeffsB = AtomicReference(coeffsB)
constructor(order: Int) : this(List(order+1) { 1f }, List(order+1) { 1f })
/* ... */
}
Dominaezzz
07/12/2021, 11:52 AMmartmists
07/12/2021, 11:55 AMDominaezzz
07/12/2021, 11:59 AMrusshwolf
07/12/2021, 12:21 PMprivate val coeffsA = AtomicReference(coeffsA.freeze())
etcmartmists
07/12/2021, 12:22 PMrusshwolf
07/12/2021, 12:25 PMIIRNode
?martmists
07/12/2021, 12:29 PMval x = AtomicReference(List(10) { 1f })
russhwolf
07/12/2021, 12:34 PMval x = AtomicReference(List(10) { 1f }.freeze())
should workrusshwolf
07/12/2021, 12:35 PMDominaezzz
07/12/2021, 12:36 PM