-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
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
How to polkavm_import/export with non-numeric types? #110
Comments
You can pass a pointer to a preallocated chunk of memory and then have the host function write to it. Alternatively if the size of the data is not known you could do it in two steps - first query the host how much memory is needed, have the guest allocate it, and then have the host write to it. On the guest side there's the derive macro which can be used to define custom marshaling strategies for custom types (e.g. see here for an example.) |
thanks. will give it a play and see if I can something working |
any plan to update polkavm_import/export macro to support advanced argument passing? or it will stick with registers and then in that case we need another library to abstract the argument marshalling work |
Depends on what exactly you mean by "advanced argument passing", but in general at least in the short term I'm not planing on expanding its capabilities beyond the basics and concentrate on making the fundamentals really solid. |
Probably a duplicate of #108 |
Looks like currently only a few numeric types are supported and the ABI is simply pass the arguments via register. This means we can only pass small arguments by value.
How can we pass large objects? Or a string or just bunch of bytes?
The text was updated successfully, but these errors were encountered: