Stream: git-wasmtime

Topic: wasmtime / PR #8907 Expose Engine::clone to c-api


view this post on Zulip Wasmtime GitHub notifications bot (Jul 07 2024 at 02:24):

CGamesPlay requested fitzgen for a review on PR #8907.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 07 2024 at 02:24):

CGamesPlay requested wasmtime-core-reviewers for a review on PR #8907.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 07 2024 at 02:24):

CGamesPlay opened PR #8907 from CGamesPlay:main to bytecodealliance:main:

This creates an API to allow cloning references to wasm_engine_t in the C API. This is simple in the Rust API which implements Clone, however it is not exposed to the C API.

Use case: in tree-sitter's wasm support, we create a store object and want to instantiate modules into it over the course of the object's lifetime. This requires a handle to the underlying engine, which means our store must be kept alongside a reference to the engine (since tree-sitter is a library, it doesn't want to assume a global wasm engine). This currently requires transferring ownership of the engine to the tree sitter store container, which means we can't reuse engine objects between multiple stores.

This pertains to https://github.com/tree-sitter/tree-sitter/issues/3454.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 08 2024 at 13:29):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 08 2024 at 13:29):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 08 2024 at 13:29):

alexcrichton created PR review comment:

Good catch! We'll need to update this documentation further nowadays because some headers are generated as part of the build now so CMake is primarily needed to get the headers right.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 08 2024 at 13:29):

alexcrichton created PR review comment:

Could the documentation be updated here to indicate that wasm_engine_delete must be called on the returned reference?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 08 2024 at 13:57):

CGamesPlay updated PR #8907.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 08 2024 at 14:34):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 08 2024 at 14:49):

alexcrichton merged PR #8907.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2024 at 00:01):

av1934413 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2024 at 00:01):

av1934413 created PR review comment:

274df2d52a8568f99e608f59046b20a948a15dea


Last updated: Dec 23 2024 at 12:05 UTC