Skip to content

Remove HostRef<T> from the C API#1926

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:remove-hostref
Jun 26, 2020
Merged

Remove HostRef<T> from the C API#1926
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:remove-hostref

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit removes HostRef<T> from the C API which only served the
purpose now of converting each type to a wasm_ref_t*. Our
implementation, however, does not guarantee that you'll get the same
wasm_ref_t* for each actual underlying item (e.g. if you put a func in
a table and then get the func as an export and from the table then
same will report false). Additionally the fate of wasm_ref_t*
seems somewhat unclear at this point.

The change here is to make the same and cast functions all abort
saying they're unimplemented. (similar to the host info functions). If
and when we get around to reimplementing these functions we can ensure
they're implemented uniformly and work well for all intended use cases.

This commit removes `HostRef<T>` from the C API which only served the
purpose now of converting each type to a `wasm_ref_t*`. Our
implementation, however, does not guarantee that you'll get the same
`wasm_ref_t*` for each actual underlying item (e.g. if you put a func in
a table and then get the func as an export and from the table then
`same` will report `false`). Additionally the fate of `wasm_ref_t*`
seems somewhat unclear at this point.

The change here is to make the `same` and cast functions all abort
saying they're unimplemented. (similar to the host info functions). If
and when we get around to reimplementing these functions we can ensure
they're implemented uniformly and work well for all intended use cases.
@github-actions github-actions Bot added the wasmtime:c-api Issues pertaining to the C API. label Jun 26, 2020
@github-actions
Copy link
Copy Markdown

Subscribe to Label Action

cc @peterhuene

Details This issue or pull request has been labeled: "wasmtime:c-api"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:c-api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@alexcrichton alexcrichton merged commit cca558c into bytecodealliance:main Jun 26, 2020
@alexcrichton alexcrichton deleted the remove-hostref branch June 26, 2020 19:34
kubkon pushed a commit to kubkon/wasmtime that referenced this pull request Jul 10, 2020
This commit removes `HostRef<T>` from the C API which only served the
purpose now of converting each type to a `wasm_ref_t*`. Our
implementation, however, does not guarantee that you'll get the same
`wasm_ref_t*` for each actual underlying item (e.g. if you put a func in
a table and then get the func as an export and from the table then
`same` will report `false`). Additionally the fate of `wasm_ref_t*`
seems somewhat unclear at this point.

The change here is to make the `same` and cast functions all abort
saying they're unimplemented. (similar to the host info functions). If
and when we get around to reimplementing these functions we can ensure
they're implemented uniformly and work well for all intended use cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:c-api Issues pertaining to the C API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants