Skip to content

GuestMemory returns pointers but does not guarantee their validity #332

@DemiMarie

Description

@DemiMarie

Functions GuestMemory and the like return pointers but do not make any guarantees about their validity, making the returned pointers useless. In practice, callers unsoundly make assumptions about the validity of pointers.

There are three alternatives I can think of:

  1. Make GuestMemory and friends unsafe to implement.
  2. Deprecate the functions returning raw pointers, and replace them with functions returning VolatileSlice, whose member functions do provide guarantees about the pointers they return.
  3. Do both (1) and (2).

Personally I prefer the third option.

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