Skip to content

Implement wasm_externref_objdel and wasm_externref_set_cleanup #2455

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

Merged
merged 4 commits into from
Aug 14, 2023

Conversation

tonibofarull
Copy link
Contributor

@tonibofarull tonibofarull commented Aug 13, 2023

Context

Some native libraries may want to explicitly delete an externref object without waiting for the module instance to be deleted.
In addition, it may want to add a cleanup function.

Proposed Changes

Implement:

  • wasm_externref_objdel to explicitly delete an externeref'd object.
  • wasm_externref_add_cleanup to add a cleanup function that is called when the externref'd object is deleted.

Acknowledgments

Thanks to @rvargas-midokura for the implementation!

@tonibofarull tonibofarull force-pushed the tbc/add-externref-helpers branch from a300e68 to caa20f5 Compare August 13, 2023 17:26
@tonibofarull tonibofarull force-pushed the tbc/add-externref-helpers branch from caa20f5 to 0b3142b Compare August 13, 2023 17:43
@tonibofarull tonibofarull changed the title Implement wasm_externref_objdel and wasm_externref_add_cleanup Implement wasm_externref_objdel and wasm_externref_set_cleanup Aug 14, 2023
@wenyongh wenyongh merged commit 8d1cf46 into bytecodealliance:main Aug 14, 2023
@tonibofarull tonibofarull deleted the tbc/add-externref-helpers branch August 14, 2023 09:01
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…ytecodealliance#2455)

## Context

Some native libraries may want to explicitly delete an externref object without
waiting for the module instance to be deleted.
In addition, it may want to add a cleanup function.

## Proposed Changes

Implement:
* `wasm_externref_objdel` to explicitly delete an externeref'd object. 
* `wasm_externref_set_cleanup` to set a cleanup function that is called when
  the externref'd object is deleted.
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