-
Notifications
You must be signed in to change notification settings - Fork 16
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
[refactor] Update the APIs related to sync host function creation #26
[refactor] Update the APIs related to sync host function creation #26
Conversation
Signed-off-by: Xin Liu <[email protected]>
…ModuleBuilder` Signed-off-by: Xin Liu <[email protected]>
Hello, I am a code review bot on flows.network. Here are my reviews of code commits in this PR. Most important findings:
Overall, the pull request brings improvements to the API for creating synchronous host functions while introducing some minor issues with formatting and code cleanliness. It would be beneficial to address these issues and provide more documentation or comments to clarify the purpose and impact of the changes. DetailsCommit 3b15b6d975ecbf4d31cb9527bc0ae8edb67dc176Key changes made in the pull request are:
Potential problems:
Overall, the changes seem to improve the API for creating synchronous host functions by accepting mutable references instead of boxed types for the Commit 1fb77418e7d511a557ffdb34f0f5a985c6470b6bKey changes:
Potential problems:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Option<&mut T>
to identify func's data as unsafe is because the lifetime of T
is not bound to the lifetime of the Function
, and T
might be moved after creating the Function
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix it as soon as possible in the upcoming updates.
#27 tracks the issue. We'll fix it in another PR. Thanks a lot! |
@L-jasmine Thanks for the review! |
In this PR, the following APIs are refactored:
wasmedge-sdk
Func::new
,Func::wrap_func
ImportObjectBuilder::with_func
,ImportObjectBuilder::with_func_by_type
PluginModuleBuilder::with_func
wasmedge-sys
Function::create_sync_func