Skip to content

Cannot instantiate a shared memory with a custom page size #9523

@alexcrichton

Description

@alexcrichton

Given this module:

(module
  (memory 1 2 shared (pagesize 1))
)

this cannot be instantiated:

$ wasmtime run -Wcustom-page-sizes foo.wat
Error: failed to run main module `foo.wat`

Caused by:
    0: failed to instantiate "foo.wat"
    1: shared memory can only be built from a static memory allocation

This is due to the fact that custom page sizes currently force a "dynamic" memory where the base pointer can change while shared memories are required to be "static" where the base pointer cannot change. Fixing this will require refactoring exactly how memories are represented internally within Wasmtime, but in the meantime I wanted to file an issue about this to have on-hand.

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