Closed kud1ing closed 6 years ago
As a general rule I would prefer to expose the unsafe
whenever Rucaja is possibly unsafe. That is, a crash / undefined behavior that happens while using a safe Rucaja function should be a bug of Rucaja.
@fpoli That's true. Like how you can do magic things like Vec::from_raw_parts
. But if we can make some Rucaja functionality definitely safe for some subset of behavior then it absolutely makes sense to wrap it with safe, idiomatic Rust.
I agree
I made up my mind and i agree that we should reduce the scope of unsafeness as much as possible.
We should prevent invalid usage of JNI, as we currently never store raw null-pointers. Crashes and unexpected null-pointer-exceptions in Java-land are bugs.
Should we hide
unsafe
inside the functions or is more honest/beneficial to leakunsafe
in the function declarations as it is?Discussion from the perspective of keep leaking unsafeness: