commit
2000401125
9 files changed
+1712
-64
No files matched your search
@@ -291,6 +291,22 @@ pub fn title_memory_section(section: usize, bytes: u64, committed: bool) {
|
||||
v.sections.push((section, bytes, committed));
|
||||
}
|
||||
|
||||
/// The runtime lets go of a section, and of its handle: no view the title
|
||||
/// sees is of it any more, and [`beside`]'s view goes.
|
||||
pub fn title_memory_section_gone(section: usize) {
|
||||
let whole = {
|
||||
let mut v = views();
|
||||
let at = v.whole.iter().position(|w| w.0 == section);
|
||||
at.map(|i| v.whole.swap_remove(i).1)
|
||||
};
|
||||
if let Some(base) = whole.filter(|&base| base != 0) {
|
||||
// SAFETY: a view of ours. Who writes through it found the section
|
||||
// in a view the title saw and holds off its unmapping
|
||||
// (`crate::watch::title_memory_reading`), which came before this.
|
||||
unsafe { mem::UnmapViewOfFile(mem::MEMORY_MAPPED_VIEW_ADDRESS { Value: base as *mut c_void }) };
|
||||
}
|
||||
}
|
||||
|
||||
/// The runtime mapped `[at, at + len)` as a view of `section` from
|
||||
/// `offset` on. Call after [`crate::title_memory_remapped`] of the range.
|
||||
pub fn title_memory_view(at: usize, len: usize, section: usize, offset: u64) {
|
||||
|
||||
Reference in new issue
Block a user