Skip to content

Commit

Permalink
Merge pull request #594 from stlankes/wasmtime
Browse files Browse the repository at this point in the history
add minimal implementation of wasmtime_memory_image_new
  • Loading branch information
stlankes authored Jun 30, 2024
2 parents 91c2c4c + f174696 commit d99c4ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions examples/wasmtime/src/capi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ pub extern "C" fn wasmtime_mmap_remap(_addr: *mut u8, _size: usize, _prot_flags:
pub extern "C" fn wasmtime_memory_image_new(
_ptr: *const u8,
_len: usize,
_ret: &mut *mut wasmtime_memory_image,
ret: &mut *mut wasmtime_memory_image,
) -> i32 {
error!("Currently. HermitOS doesn't support wasmtime_memory_image_new!");
-1
*ret = std::ptr::null_mut();
0
}

/// Maps the `image` provided to the virtual address at `addr` and `len`.
Expand All @@ -224,7 +224,7 @@ pub extern "C" fn wasmtime_memory_image_map_at(
_len: usize,
) -> i32 {
error!("Currently. HermitOS doesn't support wasmtime_memory_image_map_at!");
-1
-hermit_abi::ENOSYS
}

/// Deallocates the provided `wasmtime_memory_image`.
Expand Down

0 comments on commit d99c4ac

Please sign in to comment.