docs: add extern safety note

This commit is contained in:
Orion Kindel 2023-04-05 10:28:40 -07:00
parent 336849a058
commit c41ace15f0
Signed by untrusted user who does not match committer: orion
GPG Key ID: 6D4165AE4C928719

View File

@ -12,6 +12,11 @@ should use the `dev.toad.ffi.uX` compat classes to ensure
that the primitive casts in rust succeed.
### unsafe
#### externs
no extern fns called by java should be decorated `unsafe` and should instead be
safe functions with `unsafe` expression bodies to clearly denote the patterns
of unsafety within.
#### justification
with 1 exception described below in [# pub static mut RUNTIME](#pub-static-mut-runtime),
all uses of `unsafe` in safe functions are accompanied