-
Notifications
You must be signed in to change notification settings - Fork 624
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
[instantiation linking] create and import WASMMemoryInstance #3845
Draft
lum1n0us
wants to merge
16
commits into
bytecodealliance:dev/instantiate_linking
Choose a base branch
from
lum1n0us:feat/inst_linking_memory
base: dev/instantiate_linking
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[instantiation linking] create and import WASMMemoryInstance #3845
lum1n0us
wants to merge
16
commits into
bytecodealliance:dev/instantiate_linking
from
lum1n0us:feat/inst_linking_memory
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lum1n0us
force-pushed
the
feat/inst_linking_memory
branch
5 times, most recently
from
October 12, 2024 08:34
62b7808
to
1821dfd
Compare
lum1n0us
commented
Oct 15, 2024
lum1n0us
force-pushed
the
feat/inst_linking_memory
branch
3 times, most recently
from
October 18, 2024 09:14
6508580
to
54d45c7
Compare
including - memory create and destroy - instnace_new with imports
Besides, it is still an open question if a memory should be exported
This commit refactors the `memory_deinstantiate` function in the `wasm_runtime.c` file. It introduces a new helper function `memory_deinstantiate` to handle the destruction of memory instances. The function checks if the memory is shared and decrements the reference count before freeing the memory. It also destroys the heap handle and deallocates the linear memory. Additionally, the commit fixes the `wasm_destroy_memory` function by calling the `memory_deinstantiate` function and freeing the memory instance. These changes improve the memory management in the interpreter and ensure proper destruction of memory instances.
- Set CMAKE_BUILD_TYPE to Debug in CMakeLists.txt - Add missing printf and fflush statements in import_memory.c - Add assertion for memory data in import_memory.c - Add assertion for memory growth in import_memory.c
…i-threads, and thread_manager.c
Both `WASI_THREADS` and `THREAD_MGR` continue to use loader linking to keep a separate memory instance for each thread they create.
This commit refactors the code related to memory instantiation and import handling in the `wasm_runtime.c` and `wasm_runtime.h` files. It introduces a new function `wasm_runtime_inherit_imports` that builds a list of imports from the parent's imports. The function is used in the `thread_spawn_wrapper` function in the `lib_wasi_threads_wrapper.c` file to instantiate a module for a spawned thread. Additionally, the code in the `main.c` file is modified to handle imports from the `spectest`, `foo`, and `env` modules.
lum1n0us
force-pushed
the
feat/inst_linking_memory
branch
5 times, most recently
from
October 21, 2024 08:35
b8bdddc
to
6c0b2fa
Compare
lum1n0us
force-pushed
the
feat/inst_linking_memory
branch
from
October 21, 2024 13:49
6c0b2fa
to
a1d2c27
Compare
lum1n0us
force-pushed
the
feat/inst_linking_memory
branch
from
October 21, 2024 14:36
a1d2c27
to
7678f4d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.