wasmedge-bindgen icon indicating copy to clipboard operation
wasmedge-bindgen copied to clipboard

Make "allocate" configurable

Open abourget opened this issue 3 years ago • 0 comments

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.

abourget avatar Jan 07 '23 21:01 abourget