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:
- Make
GuestMemory and friends unsafe to implement.
- Deprecate the functions returning raw pointers, and replace them with functions returning
VolatileSlice, whose member functions do provide guarantees about the pointers they return.
- Do both (1) and (2).
Personally I prefer the third option.