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(instance) Introduce the wasm_instance structure #69

Merged
merged 2 commits into from
Jul 10, 2019

Conversation

Hywan
Copy link
Contributor

@Hywan Hywan commented Jul 10, 2019

This PR introduces a wasm_instance structure. It holds a wasmer_instance_t pointer and a wasmer_exports_t pointer. Thus, it simplifies the WasmArrayBuffer internal structure that also contained a wasmer_exports_t pointer (see #68).

It simplifies the code since we don't have to destroy the exports everytime an error happens. Exports need to be destroyed only when the wasm_instance resource is destroyed.

It finally avoids an allocation for exports everytime an exported function is invoked.

Thus, it simplifies the `WasmArrayBuffer` internal structure, where we
can remove the exports pointer.
@Hywan Hywan added 🎉 enhancement New feature or request 📦 component-extension About the PHP extension written in C/C++ labels Jul 10, 2019
@Hywan Hywan self-assigned this Jul 10, 2019
@Hywan
Copy link
Contributor Author

Hywan commented Jul 10, 2019

bors try

bors bot added a commit that referenced this pull request Jul 10, 2019
@bors
Copy link
Contributor

bors bot commented Jul 10, 2019

try

Build succeeded

@Hywan
Copy link
Contributor Author

Hywan commented Jul 10, 2019

bors r+

bors bot added a commit that referenced this pull request Jul 10, 2019
69: feat(instance) Introduce the `wasm_instance` structure r=Hywan a=Hywan

This PR introduces a `wasm_instance` structure. It holds a `wasmer_instance_t` pointer and a `wasmer_exports_t` pointer. Thus, it simplifies the `WasmArrayBuffer` internal structure that also contained a `wasmer_exports_t` pointer (see #68).

It simplifies the code since we don't have to destroy the exports everytime an error happens. Exports need to be destroyed only when the `wasm_instance` _resource_ is destroyed.

It finally avoids an allocation for exports everytime an exported function is invoked.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
@bors
Copy link
Contributor

bors bot commented Jul 10, 2019

Build succeeded

@bors bors bot merged commit 2644be9 into master Jul 10, 2019
@bors bors bot deleted the feat-instance-exports-ptr branch July 10, 2019 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 component-extension About the PHP extension written in C/C++ 🎉 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant