Skip to content

Clarification for the memory.copy instruction #40378

@Nosfy01

Description

@Nosfy01

MDN URL

https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/Memory/Copy

What specific section or headline is this issue about?

Syntax

What information was incorrect, unhelpful, or incomplete?

The code samples seem to omit that the memory.copy instruction needs both a source and destination memory (unless of course their is only memory 0).

(memory.copy (memory $memoryName) (i32.const 50) (i32.const 100) (i32.const 25))

In this example the source memory used will be memory 0 and $memoryName will be the destination.

What did you expect to see?

(memory.copy (memory $destinationMemory) (memory $sourceMemory) (i32.const 50) (i32.const 100) (i32.const 25))

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

My only source is my experimentation with compiled WebAssembly text format.
This is my first time suggesting an improvement, if my understanding of this topic is wrong or incomplete please let me know.

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:wasmWebAssembly docsneeds triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions