alef 0.24.2

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
#[unsafe(no_mangle)]
pub unsafe extern "system" fn {{ symbol }}(
    _env: EnvUnowned,
    _class: JClass,
    handle: jlong,
) {
    if handle == 0 { return; }
    // SAFETY: `handle` was allocated by the matching constructor shim and
    // ownership is transferred back here for drop via Box::from_raw.
    unsafe { let _ = Box::from_raw(handle as *mut core_crate::{{ type_name }}); }
}