Implement WASI C API.
This commit implements an initial WASI C API that can be used to instantiate and configure a WASI instance from C. This also implements a `WasiBuilder` for the C# API enabling .NET hosts to bind to Wasmtime's WASI implementation.
This commit is contained in:
@@ -29,9 +29,11 @@ namespace Wasmtime
|
||||
Interop.wasm_trap_message(trap, out var bytes);
|
||||
var byteSpan = new ReadOnlySpan<byte>(bytes.data, checked((int)bytes.size));
|
||||
|
||||
int indexOfNull = byteSpan.IndexOf((byte)0);
|
||||
int indexOfNull = byteSpan.LastIndexOf((byte)0);
|
||||
if (indexOfNull != -1)
|
||||
{
|
||||
byteSpan = byteSpan.Slice(0, indexOfNull);
|
||||
}
|
||||
|
||||
var message = Encoding.UTF8.GetString(byteSpan);
|
||||
Interop.wasm_byte_vec_delete(ref bytes);
|
||||
|
||||
Reference in New Issue
Block a user