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_ptris now
RuntimeLinearMemory::base, which returns aMemoryBase. This is either a
raw pointer or anMmapOffsetas 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
Mmapinstances.
sunshowers submitted PR review.
sunshowers created PR review comment:
Oh, and adding a
Dropimpl identified the problem withunwrap_static_image, haha, since you can't move out of a type when there's aDropimpl.
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_ptrinstances.
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 13 2025 at 19:03 UTC