Add safety comment to StableAddress impl for Mmap
This commit is contained in:
parent
5773e51678
commit
bda6d1f158
1 changed files with 4 additions and 0 deletions
|
@ -40,4 +40,8 @@ impl Deref for Mmap {
|
|||
}
|
||||
}
|
||||
|
||||
// SAFETY: On architectures other than WASM, mmap is used as backing storage. The address of this
|
||||
// memory map is stable. On WASM, `Vec<u8>` is used as backing storage. The `Mmap` type doesn't
|
||||
// export any function that can cause the `Vec` to be re-allocated. As such the address of the
|
||||
// bytes inside this `Vec` is stable.
|
||||
unsafe impl StableAddress for Mmap {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue