Skip to content
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

capi: Add imported globals to instantiate #624

Merged
merged 5 commits into from
Oct 28, 2020
Merged

Conversation

gumb0
Copy link
Collaborator

@gumb0 gumb0 commented Oct 26, 2020

No description provided.

@codecov
Copy link

codecov bot commented Oct 26, 2020

Codecov Report

Merging #624 into master will increase coverage by 0.00%.
The diff coverage is 99.03%.

@@           Coverage Diff           @@
##           master     #624   +/-   ##
=======================================
  Coverage   98.32%   98.32%           
=======================================
  Files          67       67           
  Lines        9429     9493   +64     
=======================================
+ Hits         9271     9334   +63     
- Misses        158      159    +1     

@gumb0 gumb0 force-pushed the capi-imported-globals branch 3 times, most recently from d86e365 to 496cbcf Compare October 27, 2020 10:38
@gumb0 gumb0 marked this pull request as ready for review October 27, 2020 10:48
/// @returns non-NULL pointer to instance in case of success, NULL otherwise.
///
/// @note
/// Functions in @a imported_functions are allowed to be in any order and allowed to include some
/// functions not required by the module.
/// Functions are matched to module's imports based on their module and name strings.
/// @note
/// Function expects @a imported_globals to be in the order of imports defined in the module.
Copy link
Collaborator Author

@gumb0 gumb0 Oct 27, 2020

Choose a reason for hiding this comment

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

It's weird how fizzy_resolve_instantiate currently doesn't resolve globals the way it resolves functions. C++ backend doesn't allow this currently, and I don't know how important it is.

Copy link
Member

Choose a reason for hiding this comment

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

I agree there should be a function similar to functions to resolve globals in the C++ API. That could be used here.

Probably at that point I'd rename the to instantiates as fizzy_instantiate (which does resolution) and fizzy_unsafe_instantiate (which doesn't).

@gumb0 gumb0 requested review from chfast and axic October 27, 2020 11:04
@@ -20,12 +20,12 @@ typedef struct FizzyInstance FizzyInstance;
/// The data type representing numeric values.
///
/// i64 member is used to represent values of both i32 and i64 type.
union FizzyValue
typedef union FizzyValue
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, wonder how the Rust binding will act with this, will check.

Copy link
Member

Choose a reason for hiding this comment

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

Seems to be working well.

Copy link
Member

@axic axic left a comment

Choose a reason for hiding this comment

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

Haven't done a very thorough review of the last two commits, but in general it looks good to me.

@gumb0 gumb0 merged commit 06ef9f0 into master Oct 28, 2020
@gumb0 gumb0 deleted the capi-imported-globals branch October 28, 2020 13:58
@gumb0 gumb0 mentioned this pull request Nov 3, 2020
49 tasks
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.

3 participants