mirror of
https://github.com/signalapp/libsignal.git
synced 2024-09-20 03:52:17 +02:00
304a90fe56
If garbage collection happens at exactly the wrong time, the Java wrapper around a Rust object (such as SessionRecord) can be finalized while the Rust object is being used, via its opaque 'nativeHandle' (address cast as integer). Avoid this by adding a NativeHandleGuard type that keeps the wrapper alive, as well as a low-level entry point `Native.keepAlive(...)` that does nothing but serve as a sort of GC guard, similar to `Reference.reachabilityFence()` in Java 9. |
||
---|---|---|
.. | ||
android | ||
docker | ||
gradle/wrapper | ||
java | ||
tests | ||
build_jni.sh | ||
build.gradle | ||
check_code_size.py | ||
code_size.json | ||
Dockerfile | ||
gradlew | ||
gradlew.bat | ||
Makefile | ||
settings.gradle |