Rework of FFI, adding a value identifier, so we can keep knowledge of data even when data moves.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
use crate::defines::LevelInt;
|
||||
use crate::ffi::{ExternPointer, OwnedPtr};
|
||||
use crate::ffi::{ExternPointer, IdentifiablePointer, OwnedPtr};
|
||||
use crate::static_data::LibrarySettings;
|
||||
use std::ptr::drop_in_place;
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn library_settings_new(max_level: LevelInt) -> OwnedPtr<LibrarySettings> {
|
||||
Box::into_raw(Box::new(LibrarySettings::new(max_level)))
|
||||
extern "C" fn library_settings_new(max_level: LevelInt) -> IdentifiablePointer<LibrarySettings> {
|
||||
Box::new(LibrarySettings::new(max_level)).into()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
||||
Reference in New Issue
Block a user