Previously moodule::link used the function pointer as a template
argument, because the function linked through m3_LinkRawFunctionEx
didn't receive any context pointer, so each linked function needed
a unique wrapper.
With the introduction of m3_LinkRawFunctionEx, it is possible to move
the function pointer to a regular argument.
This reduces code size when linking many functions with the same
signature.
This also makes it possible to later support arbitrary callable
objects instead of function pointers, using the same API.
Co-authored-by: Volodymyr Shymanskyy <vshymanskyi@gmail.com>
* cpp: env.parse_module: ensure the file is opened without skipws
Closes https://github.com/wasm3/wasm3/issues/124
* cpp: demonstrate loading a module from file
* cpp: remove leftover note about function::call doing string conversion
* cpp: add missing return value checks for m3_GetResults
* cpp: use m3ApiGetArg, m3ApiReturn, m3_GetResults for stack access
Still relies on an internal m3_api_defs.h, but at least less likely
to get broken, and doesn't depend on M3Runtime internals.
* cpp: use m3_Call in function::call, getting rid of string conversions
When function::call was first written, m3_Call did not exist yet, and
the only way to call functions was through m3_CallArgv which takes
arguments as strings. Now that m3_Call is available, string conversion
can be removed.
Closes https://github.com/wasm3/wasm3/issues/219