sunshowers edited PR #9687.
sunshowers updated PR #9687.
sunshowers edited PR #9687:
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 anMmapOffset
as described below.
MmapOffset
: A combination of a reference to an mmap and an offset into it.
Logically represents a pointer into a mapped section of memory.In future work, we'll move more image-mapping code over to
Mmap
instances.
sunshowers submitted PR review.
sunshowers created PR review comment:
Oh, and adding a
Drop
impl identified the problem withunwrap_static_image
, haha, since you can't move out of a type when there's aDrop
impl.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Ah ok that all makes sense to me yeah, thanks for checking!
sunshowers commented on PR #9687:
Fixing the issues
sunshowers updated PR #9687.
sunshowers commented on PR #9687:
Hmm, actually I want to rename the os-specific Mmap
as_ptr
instances.
sunshowers updated PR #9687.
sunshowers submitted PR review.
sunshowers created PR review comment:
Changed some of this code's pointer typology (though not the arithmetic) -- would be worth a look.
alexcrichton merged PR #9687.
Last updated: Dec 23 2024 at 12:05 UTC