Initial work on DynamicLibrary up to and including the Pokemon model.

This commit is contained in:
2023-01-03 16:53:58 +01:00
parent 62a3ffb2bf
commit 7511f56b1a
6 changed files with 42 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ use crate::dynamic_data::{
};
use crate::ffi::{IdentifiablePointer, OwnedPtr};
use crate::static_data::StaticData;
use std::ptr::drop_in_place;
use std::sync::Arc;
/// Instantiates a new DynamicLibrary with given parameters.
@@ -25,3 +26,9 @@ extern "C" fn dynamic_library_new(
a.into()
}
}
/// Drops a dynamic library.
#[no_mangle]
extern "C" fn dynamic_library_drop(ptr: OwnedPtr<Arc<dyn StaticData>>) {
unsafe { drop_in_place(ptr) };
}