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

feat(compiler): Allow importing a memory #1661

Merged
merged 2 commits into from
Feb 14, 2023
Merged

feat(compiler): Allow importing a memory #1661

merged 2 commits into from
Feb 14, 2023

Conversation

ospencer
Copy link
Member

Works towards #1029

For compilers that support this functionality, they just support importing from env.memory. We could make this a bit more complicated and allow passing the module name and memory name, but for now I don't think this is necessary.

We don't currently have the ability to add a test for this because the memory import happens after linking.

@ospencer ospencer self-assigned this Feb 10, 2023
@ospencer ospencer changed the title feat: Allow importing a memory feat(compiler): Allow importing a memory Feb 10, 2023
Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

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

Are there any tests we could write for this?

@ospencer
Copy link
Member Author

@phated I mentioned in the description that no there isn't, but I remembered a way.

@ospencer
Copy link
Member Author

Test added.

Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for figuring out a test

@phated phated added this pull request to the merge queue Feb 14, 2023
Merged via the queue into main with commit 3140ba2 Feb 14, 2023
@phated phated deleted the oscar/import-memory branch February 14, 2023 05:11
av8ta pushed a commit to av8ta/grain that referenced this pull request Apr 11, 2023
* feat: Allow importing a memory

* add import_memory linking test
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