somewhere it's noted about how `object` s are init...
# kotlin-native
b
somewhere it's noted about how
object
s are initialized during runtime init on native. Does anyone know where that is?
o
Singleton objects are not inited on runtime init, but on the first access
My understanding was it did to enforce immutability invariant for concurrency. Not true? Swear I read this in docs somewhere
@olonho what exactly does
InitOrDeinitGlobalVariables
initialize at runtime then?
I think I read too much into this: https://github.com/JetBrains/kotlin-native/blob/master/IMMUTABILITY.md
Top level/global variables of non-primitive types are by default accessible in the main thread (i.e., the thread which initialized Kotlin/Native runtime first) only.
o
val x = 42
on top level is global variable
b
Got it. So only those. Thanks!
Which matches JVM 👍