Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
589: wasmer-c-api-changes: making `wasmer_byte_array` fields `public` r=bjfish a=YaronWittenstein I've added this PR since I've tests that need access to `wasmer_byte_array` field. Here is an example: https://github.com/spacemeshos/svm/blob/52f04b52cc9a5227030f3dd3499e04c6cbe143d9/crates/svm-wasmer-c-api/tests/c_api.rs#L96 ```rust unsafe fn cast_wasmer_byte_array_to_string(wasmer_bytes: &wasmer_byte_array) -> String { let slice: &[u8] = std::slice::from_raw_parts(wasmer_bytes.bytes, wasmer_bytes.bytes_len as usize); if let Ok(s) = std::str::from_utf8(slice) { s.to_string() } else { panic!("error converting `wasmer_byte_array` to string") } } ``` @syrusakbary @bjfish @Hywan Co-authored-by: Yaron Wittenstein <[email protected]> Co-authored-by: Brandon Fish <[email protected]>
- Loading branch information