fitzgen opened PR #7920 from fitzgen:registry-in-engine-directly
to bytecodealliance:main
:
Rather than an
Arc<RwLock<TypeRegistryInner>>
.This also removes the
Arc
insideTypeRegistry
and we effectively reuseEngine
's internalArc
instead.Also, to avoid various
TypeRegistry
methods needing to take anEngine
to construct theirRegisteredType
results, but then needing to assert that the given engine is this registry's engine, I turned the methods intoTypeRegistry
constructors. These constructors take just an&Engine
and then access the underlyingTypeRegistry
as needed, effectively making that property hold statically.This is a minor clean up on its own, but is a big help for follow up work I am doing for Wasm GC and typed function references, where being able to grab a reference to the engine that a
FuncType
is registered within will prevent needing to thread in additional engine parameters to various places and then assert that the engine is the engine that the type is registered within, and etc...<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
fitzgen requested alexcrichton for a review on PR #7920.
fitzgen requested wasmtime-core-reviewers for a review on PR #7920.
pchickey submitted PR review.
fitzgen has enabled auto merge for PR #7920.
fitzgen merged PR #7920.
Last updated: Oct 23 2024 at 20:03 UTC