This PR updates `extism_output_get` to return an actual pointer to the
output value (`const uint8_t* extism_output_get(PluginIndex plugin)`
instead of `void extism_output_get(PluginIndex plugin, uint8_t *buffer,
uint64_t length)`), this pointer will only be valid until the next call,
but it makes it possible to access the output data without copying.
The input buffer is also not copied and the same issue applies:
the input buffer must not change during `call`.
Co-authored-by: Steve Manuel <steve@dylib.so>
This gives host the ability to re-use plugin descriptors instead of
loading a new plugin each time. The plugin memory and everything is
reset, so no state is shared with the newly loaded plugin.
Co-authored-by: Steve Manuel <steve@dylib.so>
I noticed when calling set_log_file that it's on the top-level namespace.
And so is the rest of the gem. It's not a good idea to do this as it
pollutes the user's application. Best practice is to wrap all code in a
module which by convention is the gem name.
I was also getting `Uninitialized constant FFI:NIL` and in the
set_log_file method and I could not tell why it was needed. I changed it
to a regular ruby nil. If it's needed for some reason I'll change it
back or move to another PR.