Skip to content

Commit

Permalink
update: MM note and target description (#4403)
Browse files Browse the repository at this point in the history
  • Loading branch information
danil-pavlov authored Sep 3, 2024
1 parent c6c6e45 commit 39ebf81
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 22 deletions.
18 changes: 5 additions & 13 deletions docs/topics/native/native-migration-guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
[//]: # (title: Migrate to the new memory manager)

> Support for the legacy memory manager has been completely removed in Kotlin 1.9.20. Migrate your projects to
> the current memory model, enabled by default since Kotlin 1.7.20.
>
{type="note"}

This guide compares the new [Kotlin/Native memory manager](native-memory-manager.md) with the legacy one and
describes how to migrate your projects.

Expand Down Expand Up @@ -74,19 +79,6 @@ To support the new memory manager, remove usages of the affected API:
| [The `WorkerBoundReference<out T : Any>` class](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.concurrent/-worker-bound-reference/) | Use `T` directly. |
| [The `DetachedObjectGraph<T>` class](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.concurrent/-detached-object-graph/) | Use `T` directly. To pass the value through the C interop, use [the StableRef class](https://kotlinlang.org/api/latest/jvm/stdlib/kotlinx.cinterop/-stable-ref/). |

## Support both new and legacy memory managers

If you're a library author and need to maintain support for the legacy memory manager or want to have a fallback in case of
issues with the new memory manager, you can temporarily support code for both new and legacy memory managers.

To ignore deprecation warnings, do one of the following:

* Annotate usages of the deprecated API with `@OptIn(FreezingIsDeprecated::class)`.
* Apply `languageSettings.optIn("kotlin.native.FreezingIsDeprecated")` to all the Kotlin source sets in Gradle.
* Pass the compiler flag `-opt-in=kotlin.native.FreezingIsDeprecated`.

See [Opt-in requirements](opt-in-requirements.md) for more details.

## What's next

* [Learn about the new memory manager](native-memory-manager.md)
Expand Down
18 changes: 9 additions & 9 deletions docs/topics/native/native-target-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ Mind the following terms used in tier tables:
* We can't promise a source and binary compatibility between different compiler releases, though such changes for these
targets are quite rare.

| Gradle target name | Target triple | Running tests | Description |
|-------------------------|---------------------------------|---------------|----------------------------------------------------------------------|
| `androidNativeArm32` | `arm-unknown-linux-androideabi` | | [Android NDK](https://developer.android.com/ndk) on ARM32 platforms |
| `androidNativeArm64` | `aarch64-unknown-linux-android` | | [Android NDK](https://developer.android.com/ndk) on ARM64 platforms |
| `androidNativeX86` | `i686-unknown-linux-android` | | [Android NDK](https://developer.android.com/ndk) on x86 platforms |
| `androidNativeX64` | `x86_64-unknown-linux-android` | | [Android NDK](https://developer.android.com/ndk) on x86_64 platforms |
| `mingwX64` | `x86_64-pc-windows-gnu` || 64-bit [MinGW](https://www.mingw-w64.org) on Windows 7 and later |
| Apple macOS hosts only: | | | |
| `watchosDeviceArm64` | `aarch64-apple-watchos` | | Apple watchOS on ARM64 platforms |
| Gradle target name | Target triple | Running tests | Description |
|-------------------------|---------------------------------|---------------|-----------------------------------------------------------------------------------------|
| `androidNativeArm32` | `arm-unknown-linux-androideabi` | | [Android NDK](https://developer.android.com/ndk) on ARM32 platforms |
| `androidNativeArm64` | `aarch64-unknown-linux-android` | | [Android NDK](https://developer.android.com/ndk) on ARM64 platforms |
| `androidNativeX86` | `i686-unknown-linux-android` | | [Android NDK](https://developer.android.com/ndk) on x86 platforms |
| `androidNativeX64` | `x86_64-unknown-linux-android` | | [Android NDK](https://developer.android.com/ndk) on x86_64 platforms |
| `mingwX64` | `x86_64-pc-windows-gnu` || 64-bit Windows 7 and later using [MinGW](https://www.mingw-w64.org) compatibility layer |
| Apple macOS hosts only: | | | |
| `watchosDeviceArm64` | `aarch64-apple-watchos` | | Apple watchOS on ARM64 platforms |

> The `linuxArm32Hfp` target is deprecated and will be removed in future releases.
>
Expand Down

0 comments on commit 39ebf81

Please sign in to comment.