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

Always call runtime.reset() in App.resetCart() #666

Merged
merged 1 commit into from
Oct 3, 2023
Merged

Conversation

majaha
Copy link
Contributor

@majaha majaha commented Sep 30, 2023

I think this is technically the right thing to do, just in case the wasm start function or WASI _start/_initialize functions read from memory and then set some global variables (I don't know why they would, but they could.)
Probably wouldn't be necessary if we fixed the global variable problem, and saved them in the State? Although thinking about it, there's other global state like wasm tables that we should worry about.

(Aside: I think we should try to tidy up the abstraction between runtime.reset(), runtime.load() and App.resetCart() a little, they seem a bit inter-dependant.)

Sorry for the train-of-thought pull request, I just find it helpful to have things written down 😊

I think this is technically the right thing to do, just in case the wasm start function or WASI _start/_initialize functions read from memory and then set some global variables (I don't know why they would, but they could.) Probably wouldn't be necessary if we fixed the global variable problem, maybe?
@aduros
Copy link
Owner

aduros commented Oct 3, 2023

Makes sense! Thanks for digging into this.

@aduros aduros merged commit 1fb4e05 into aduros:main Oct 3, 2023
@majaha majaha deleted the patch-1 branch February 18, 2024 08:38
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.

2 participants