In the wasmtime codebase there are two kinds of mmaps: those that are always backed by anonymous memory and are always aligned, and those that are possibly file-backed and so the length might be unaligned. In https://github.com/bytecodealliance/wasmtime/pull/9620 I accidentally mixed the two up in a way that was a ticking time bomb.
To resolve this, add a type parameter to Mmap to distinguish between the cases. All of wasmtime's users are clearly either one or the other, so it's quite simple in the end.
In the wasmtime codebase there are two kinds of mmaps: those that are always backed by anonymous memory and are always aligned, and those that are possibly file-backed and so the length might be unaligned. In https://github.com/bytecodealliance/wasmtime/pull/9620 I accidentally mixed the two up in a way that was a ticking time bomb.
To resolve this, add a type parameter to
Mmap
to distinguish between the cases. All of wasmtime's users are clearly either one or the other, so it's quite simple in the end.