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,12 +1,12 @@
|
||||
use crate::defines::LevelInt;
|
||||
use crate::ffi::{BorrowedPtr, ExternPointer, OwnedPtr};
|
||||
use crate::ffi::{BorrowedPtr, ExternPointer, IdentifiablePointer, OwnedPtr};
|
||||
use crate::static_data::{GrowthRate, GrowthRateLibrary};
|
||||
use std::ffi::{c_char, CStr};
|
||||
use std::ptr::drop_in_place;
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn growth_rate_library_new(capacity: usize) -> OwnedPtr<GrowthRateLibrary> {
|
||||
Box::into_raw(Box::new(GrowthRateLibrary::new(capacity)))
|
||||
extern "C" fn growth_rate_library_new(capacity: usize) -> IdentifiablePointer<GrowthRateLibrary> {
|
||||
Box::new(GrowthRateLibrary::new(capacity)).into()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
||||
Reference in New Issue
Block a user