wasmedge-bindgen
wasmedge-bindgen copied to clipboard
Make "allocate" configurable
It would be nice to be able to customize the "allocate" export name. TinyGo for instance, generates a function called "malloc" instead of "allocate". Perhaps auto-detect, if "allocate" and/or "malloc" exists in the module exports even.
I tried with:
func (b *Bindgen) SetAllocateExport(funcName string) {
b.allocateFunc = funcName
}
and a new Bindgen variable called allocatedFunc it worked for TinyGo.
If you're open to a contribution, let me know.