alexcrichton opened PR #11885 from alexcrichton:refactor-resources to bytecodealliance:main:
This commit adds a new type
wasmtime::component::ResourceDynamicto
the embedding API which internally is more-or-less the same as
Resource<T>but with different type information. This
ResourceDynamicspecifically enables storing runtime information for
managing the type of the resource as opposed toResource<T>which
requires static information.The main goal of this type is to enable exposing resources in the C API
of Wasmtime. Currently there is no way to define different resource
types in the C API because the only option isResource<T>. With this
type it will be possible to create distinct resource types in the C API
for embedders to use.cc https://github.com/bytecodealliance/wasmtime/issues/11437
alexcrichton requested dicej for a review on PR #11885.
alexcrichton requested wasmtime-core-reviewers for a review on PR #11885.
alexcrichton commented on PR #11885:
I'll note that to achieve this I felt it necessary to do some refactoring first. I've split up all of the refactorings as separate commits so this is likely easiest to look at commit-by-commit rather than all-at-once.
dicej submitted PR review.
dicej created PR review comment:
//! inside of a store. The `ResourceAny::resource_drop` method, or a conversion
dicej created PR review comment:
// crate failed to compile with obscure errors. At least this is an internal
alexcrichton updated PR #11885.
alexcrichton has enabled auto merge for PR #11885.
alexcrichton merged PR #11885.
Last updated: Dec 06 2025 at 06:05 UTC