1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-20 06:21:09 +02:00

Add speaker notes to JNI slide (#2495)

Part of #1083.
This commit is contained in:
Martin Geisler 2024-12-05 12:30:03 -05:00 committed by GitHub
parent 69d4fc13a4
commit 54e0eab236
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,3 +38,14 @@ Finally, you can build, sync, and run the binary:
```shell
{{#include ../build_all.sh:helloworld_jni}}
```
<details>
- 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.
</details>