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

Globals are already stored inside the VMContext. #1758

Closed
wants to merge 1 commit into from

Conversation

nlewycky
Copy link
Contributor

@nlewycky nlewycky commented Oct 23, 2020

I claim these two TODOs are both detritus. Change my mind 😉

Verified

This commit was signed with the committer’s verified signature.
vmarta Vincent Marta
@@ -909,8 +909,6 @@ impl VMBuiltinFunctionsArray {
/// The struct here is empty, as the sizes of these fields are dynamic, and
/// we can't describe them in Rust's type system. Sufficient memory is
/// allocated at runtime.
///
/// TODO: We could move the globals into the `vmctx` allocation too.
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at InstanceHandle, it looks like globals have an extra layer of indirection on them

            instance.globals_ptr() as *mut NonNull<VMGlobalDefinition>,

Whereas everything else only has 1, so it looks like this comment is still valid.

We could probably fix this in the same way that #1687 is fixing memory/table

@@ -255,7 +255,6 @@ impl Instance {
/// Return the indexed `VMGlobalDefinition`.
fn global_ptr(&self, index: LocalGlobalIndex) -> NonNull<VMGlobalDefinition> {
let index = usize::try_from(index.as_u32()).unwrap();
// TODO:
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what this TODO is referring to... maybe the double pointer thing?

@nlewycky nlewycky marked this pull request as draft October 23, 2020 22:43
@syrusakbary
Copy link
Member

Closing this PR as is stale

@syrusakbary syrusakbary closed this Mar 4, 2021
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.

None yet

3 participants