From 54e0eab236e815fedb3b8268aa502b181542cc8c Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 5 Dec 2024 12:30:03 -0500 Subject: [PATCH] Add speaker notes to JNI slide (#2495) Part of #1083. --- src/android/interoperability/java.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/android/interoperability/java.md b/src/android/interoperability/java.md index 3000a42b888..9ab8c644dff 100644 --- a/src/android/interoperability/java.md +++ b/src/android/interoperability/java.md @@ -38,3 +38,14 @@ Finally, you can build, sync, and run the binary: ```shell {{#include ../build_all.sh:helloworld_jni}} ``` + +
+ +- The `unsafe(no_mangle)` attribute instructs Rust to emit the + `Java_HelloWorld_hello` symbol exactly as written. This is important so that + Java can recognize the symbol as a `hello` method on the `HelloWorld` class. + + - By default, Rust will mangle (rename) symbols so that a binary can link in + two versions of the same Rust crate. + +