mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-25 06:31:32 +00:00
c-api: adding wasmer_instance_context_get
(instance.rs
)
This commit is contained in:
@ -108,6 +108,18 @@ pub unsafe extern "C" fn wasmer_instantiate(
|
||||
wasmer_result_t::WASMER_OK
|
||||
}
|
||||
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasmer_instance_context_get(
|
||||
instance: *mut wasmer_instance_t,
|
||||
) -> *const wasmer_instance_context_t {
|
||||
let instance_ref = &*(instance as *const Instance);
|
||||
|
||||
let ctx: *const Ctx = instance_ref.context() as *const _;
|
||||
|
||||
ctx as *const wasmer_instance_context_t
|
||||
}
|
||||
|
||||
/// Calls an instances exported function by `name` with the provided parameters.
|
||||
/// Results are set using the provided `results` pointer.
|
||||
///
|
||||
|
Reference in New Issue
Block a user