Skip to content

Conversation

@ludfjig
Copy link
Contributor

@ludfjig ludfjig commented Aug 12, 2025

Closes #152

Comment on lines +134 to +136
// Module must export malloc and free as these
// are used to marshal param/return values
if instance.get_func(&mut store, "malloc").is_none() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only true if the module uses complex data types like string? I think simple args like int and such can be directly used on the stack

This rust example doesn't export malloc and seems to be working https://github.com/hyperlight-dev/hyperlight-wasm/blob/main/src/rust_wasm_samples/src/lib.rs

@ludfjig
Copy link
Contributor Author

ludfjig commented Aug 13, 2025

Closing as we only require malloc/free when using string/vec as parameters

@ludfjig ludfjig closed this Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

very module exports malloc/free when loading

3 participants