We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to implement an ImportFunction that returns a string but am failing to do so. Seems to just crash. Is this even possible?
This about how far I got:
private void RunWASMTest() { Import getPlatformFunc = new Import("index", "getPlatformExtern", new ImportFunction((Func<InstanceContext, int>) GetPlatform)); _memory = Memory.Create(minPages: 256, maxPages: 256); Import memoryImport = new Import("env", "memory", _memory); byte[] wasm = File.ReadAllBytes("AssemblyScript/optimized.wasm"); Instance instance = new Instance(wasm, memoryImport, getPlatformFunc); } private int GetPlatform(InstanceContext ctx) { //Figure out code for how to write string to unmanaged memory here: return 0; }
Can ImportFunctions take Funcs like that?
How would I do this exactly of returning a string on an imported method call?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am trying to implement an ImportFunction that returns a string but am failing to do so. Seems to just crash. Is this even possible?
This about how far I got:
Can ImportFunctions take Funcs like that?
How would I do this exactly of returning a string on an imported method call?
The text was updated successfully, but these errors were encountered: