Noob question, will freezing be necessary if kotli...
# kotlin-native
u
Noob question, will freezing be necessary if kotlin gets value types
👌 1
l
Maybe not, especially with the new garbage collector that might be ready by the time value classes are fully into Kotlin.
cc @napperley
n
I was assuming that Vlastimil Brecka was talking about the current Kotlin Native memory model. Louis is correct that freezing won't be required under the new Kotlin Native memory model.
l
Even with the current one, it's only if you need to share it to more than one thread.
🆗 1
u
Right, but because of mutability. If there is actually none possible as in true value classes, then, whats it for?
l
Make current Kotlin/Native runtime happy when you share the instance to more than one thread. If you freeze something that references it (e.g. a capturing lambda), it will be frozen as well.
n
That is part of the memory model's opinionated nature.