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

[instantiation linking] Refactor wasm_runtime_instantiate() #3893

Conversation

lum1n0us
Copy link
Collaborator

@lum1n0us lum1n0us commented Nov 1, 2024

based #3845 and #3887

@lum1n0us lum1n0us force-pushed the fix/optimize_runtime_instantiate branch from 4016457 to 36646a0 Compare November 1, 2024 15:49
@lum1n0us lum1n0us changed the title Refactor wasm_runtime_instantiate() [instantiation linking] Refactor wasm_runtime_instantiate() Nov 3, 2024
@lum1n0us lum1n0us marked this pull request as ready for review November 3, 2024 07:52
@lum1n0us lum1n0us force-pushed the fix/optimize_runtime_instantiate branch 5 times, most recently from edddd11 to f261840 Compare November 4, 2024 07:14
@lum1n0us lum1n0us force-pushed the fix/optimize_runtime_instantiate branch from f261840 to b71bee8 Compare November 4, 2024 07:48
The main goal is to let existed code run without modification
…ctor related import handling in thread management
- Remove unnecessary blank line in FindWASISDK.cmake for improved readability
- Format function declaration for wasm_runtime_destroy_imports for consistency
core/iwasm/common/wasm_runtime_common.c Outdated Show resolved Hide resolved
core/iwasm/common/wasm_runtime_common.c Outdated Show resolved Hide resolved
core/iwasm/common/wasm_runtime_common.c Show resolved Hide resolved
Copy link
Contributor

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

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

LGTM


WASMExternInstance *spawned_imports = runtime_malloc(
sizeof(WASMExternInstance) * (uint64)spawned_import_count, NULL,
error_buf, error_buf_size);
Copy link
Contributor

Choose a reason for hiding this comment

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

An improvement is to malloc memory only when spawned_import_count > 0, so as to avoid warning of allocating memory with size 0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok. I will finish ⬆️ in #3898

@lum1n0us lum1n0us merged commit 8c48d71 into bytecodealliance:dev/instantiate_linking Nov 21, 2024
383 checks passed
@lum1n0us lum1n0us deleted the fix/optimize_runtime_instantiate branch November 21, 2024 02:16
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