Skip to content

Implement TryClone for RegisteredType and RecGroupEntry in the types registry#12619

Open
fitzgen wants to merge 3 commits intobytecodealliance:mainfrom
fitzgen:try-clone-registered-type-rec-group-entry
Open

Implement TryClone for RegisteredType and RecGroupEntry in the types registry#12619
fitzgen wants to merge 3 commits intobytecodealliance:mainfrom
fitzgen:try-clone-registered-type-rec-group-entry

Conversation

@fitzgen
Copy link
Member

@fitzgen fitzgen commented Feb 18, 2026

And also make it so that cloning it doesn't actually require any allocations by
wrapping the inner `GcStructLayout` in an `Arc`.
@fitzgen fitzgen requested a review from a team as a code owner February 18, 2026 21:00
@fitzgen fitzgen requested review from alexcrichton and removed request for a team February 18, 2026 21:00

impl TryClone for RegisteredType {
fn try_clone(&self) -> Result<Self, OutOfMemory> {
Ok(self.clone())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the nontrivial complexity here, should this handwritten impl be the try-clone version and Clone is try_clone().panic_on_oom()?

@github-actions github-actions bot added wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:ref-types Issues related to reference types and GC in Wasmtime labels Feb 18, 2026
@github-actions
Copy link

Subscribe to Label Action

cc @fitzgen

Details This issue or pull request has been labeled: "wasmtime:api", "wasmtime:ref-types"

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

  • fitzgen: wasmtime:ref-types

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

Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:ref-types Issues related to reference types and GC in Wasmtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments