Kotlin/Native iOS 和 Android 上的垃圾收集

Kotlin/Native Garbage collection on iOS and Android

我需要在 Kotlin Native 中为 iOS 和 Android 开发一个多平台模块。根据 kotlinlang 文档:

Objective-C and Swift use reference counting. Kotlin/Native has it's own garbage collection too. Kotlin/Native garbage collection is integrated with Objective-C/Swift reference counting.

是否意味着为iOS编译的Kotlin/Native没有使用CMS(Concurrent Mark Sweep)而使用ARC(Automatic Reference Counting)?

是否有可能用 Kotlin 编写并为 iOS 编译的公共模块可能会泄漏,而为 Android 编译的同一模块可能完全没问题?

Kotlin/Native 即使在 Android 上也不使用并发标记-清除垃圾收集器。它使用带有循环收集器的自动引用计数器来收集循环垃圾 (https://github.com/JetBrains/kotlin-native/blob/master/FAQ.md)。因此在两个平台上的行为应该或多或少相同。