sunshowers opened PR #9681 from sunshowers:map-at-mmap
to bytecodealliance:main
:
This is part of the work to centralize memory management into the
mmap
module. This commit introduces a few structures which aid in that process, and
starts converting one of the functions (MemoryImageSource::map_at
) into this
module.The structures introduced are:
MemoryBase
:RuntimeLinearMemory::base_ptr
is now
RuntimeLinearMemory::base
, which returns aMemoryBase
. This is either a
raw pointer or an mmap + an offset into it.
MmapOffset
: A combination of a reference to an mmap and an offset into it.
Logically represents a pointer into a mapped section of memory.
MmapOffsetRaw
: Some components likeMemoryImageSlot
logically work on
borrowed memory, but adding lifetime parameters to them would introduce
self-reference issues. Instead, store a raw form of theMmapOffset
such
that it can be reconstructed at runtime. This should work for most future
work here, but not all of it -- I've written out some comments along with
ideas.
sunshowers requested alexcrichton for a review on PR #9681.
sunshowers requested wasmtime-core-reviewers for a review on PR #9681.
sunshowers updated PR #9681.
sunshowers updated PR #9681.
Last updated: Dec 23 2024 at 13:07 UTC