Skip to content

Structured cloning of WebAssembly.Memory is not defined #2155

Description

@annevk

At least Gecko and WebKit support serializing & deserializing WebAssembly.Memory objects. Yet https://webassembly.github.io/spec/web-api/#serialization only covers WebAssembly.Module.

I also couldn't find test coverage for this on WPT.

Activity

  1. eqrion commented on May 7, 2026

    @eqrion
    Collaborator

    Just to clarify, this is only serializing/deserializing shared WebAssembly.Memory right? I don't think Gecko supports doing that for unshared memories. You could make a copy of the underlying ArrayBuffer if you want, but it's not transferable.

    Technically the threads proposal hasn't merged yet, and so shared memory isn't defined here yet. I looked upstream though and it is missing a definition for this in the specification there.

  2. annevk commented on May 8, 2026

    @annevk
    MemberAuthor

    I created some tentative tests here to clarify what I mean and what I think the specification needs to require: web-platform-tests/wpt#59748.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions