hakuban 0.8.5

Data-object sharing library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::ffi::c_void;

#[repr(C)]
pub struct FFIBorrowedArray {
	pub length: usize,
	pub pointer: *mut c_void,
}

#[repr(C)]
pub struct FFIOwnedArray {
	pub length: usize,
	pub pointer: *mut c_void,
}

#[no_mangle]
pub extern "C" fn hakuban_array_drop(array: FFIOwnedArray) {
	drop(unsafe { Vec::from_raw_parts(array.pointer, array.length, array.length) });
}