dotnet-wasi-sdk
dotnet-wasi-sdk copied to clipboard
Exporting functions
I'm trying to write a module that exports a function so that it's callable from another runtime. I've tried using UnmanagedCallersOnly, which I've seen be usable in other runtimes.
using System.Runtime.InteropServices;
using Extism;
[UnmanagedCallersOnly(EntryPoint = "add_two")]
static int add_two() {
return 0;
}
I seem to only get the following exported functions:
file format wasm 0x1
Section Details:
Export[6]:
- memory[0] -> "memory"
- global[1] -> "__heap_base"
- global[2] -> "__data_end"
- func[7882] <_start> -> "_start"
- func[7883] <free> -> "free"
- func[7884] <malloc> -> "malloc"
Is this possible to accomplish with this SDK?