From ed0b65e19c6d3f04e1066597b8d57ccbad45f5a3 Mon Sep 17 00:00:00 2001 From: Alexander Shabalin Date: Wed, 1 Sep 2021 06:54:09 +0000 Subject: [PATCH] [K/N] A bit more on the new MM --- kotlin-native/NEW_MM.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kotlin-native/NEW_MM.md b/kotlin-native/NEW_MM.md index e7fa89829ea..ad3156633e8 100644 --- a/kotlin-native/NEW_MM.md +++ b/kotlin-native/NEW_MM.md @@ -11,6 +11,8 @@ In particular: * `Worker.executeAfter` will no longer require `operation` to be frozen, and `Worker.execute` will no longer require `producer` to return an isolated object subgraph. +Also, reference cycles containing `AtomicReference` and `FreezableAtomicReference` do not cause memory leaks anymore. + A few caveats: * As with the previous MM, memory is not reclaimed eagerly: an object is reclaimed only when GC happens. This extends to Swift/ObjC objects that crossed interop boundary into Kotlin/Native. @@ -72,6 +74,8 @@ kotlin.targets.withType(KotlinNativeTarget::class.java) { } ``` +If `kotlin.native.isExperimentalMM()` returns `true`, you've successfully enabled the new memory model. + ### Update the libraries To fully take advantage of the new MM, newer versions of libraries were released: