Hello guys, I want to know some more detail about...
# kotlin-native
u
Hello guys, I want to know some more detail about the iOS integration of KN memory management, here are my questions: 1. What will happen to ARC when a Objective-C object gets into the Kotlin world. When will it be retained and released. I guess that once the OC object gets into the KT world, it will be retained, and once the Kotlin GC sweeps this object it will be released. Is that true? 2. What will happen when a Kotlin object gets into Objective-C world. How can Kotlin GC knows that this object is being holding by some Objective-C code and it cannot be reclamed. (for normal Kotlin object, collection type, function type, ...) 3. What really happen when using autoreleasepool (I say the Kotlin autoreleasepool), how can it effects ARC? This doc [https://kotlinlang.org/docs/native-ios-integration.html#objective-c-objects-lifecycle] introduced a scenario, but I still don't know why the Objective-C objects will live longer than they should without autoreleasepool. We are struggling with some dangling pointer problem, maybe related to my above problems. After reading this doc [https://kotlinlang.org/docs/native-ios-integration.html] I still have no idea.
1