Merge agent/textures: lazy pool views (VICTORY_LAZY_VIEWS, off by default); mapping takes the remapping lock first
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
commit
72a546b0f2
5 files changed
+408
-15
No files matched your search
@@ -8287,7 +8287,9 @@ pub(crate) fn copy_mapped(dst: *mut u8, src: *const u8, len: usize, title_dst: b
|
||||
return;
|
||||
}
|
||||
if title_dst {
|
||||
// The kernel writes the destination: it must not be guarded.
|
||||
// The kernel writes the destination: it must not be guarded, and it
|
||||
// must be a mapping of the host's.
|
||||
crate::watch::materialize(dst as usize, len);
|
||||
crate::watch::writing(dst as usize, len);
|
||||
}
|
||||
#[cfg(feature = "diagnostics")]
|
||||
@@ -8440,6 +8442,9 @@ pub(crate) fn read_there(src: *const u8, dst: &mut [u8]) -> usize {
|
||||
fn read(src: *const u8, dst: *mut u8, len: usize) -> bool {
|
||||
use windows_sys::Win32::System::Diagnostics::Debug::ReadProcessMemory;
|
||||
use windows_sys::Win32::System::Threading::GetCurrentProcess;
|
||||
// (The kernel's read does not fault into the handler that makes lazily
|
||||
// mapped title memory real.)
|
||||
crate::watch::materialize(src as usize, len);
|
||||
if crate::safecopy::on() {
|
||||
// SAFETY: the destination is mapped writable memory of `len` bytes;
|
||||
// a source page that is not there fails the copy.
|
||||
@@ -8481,6 +8486,7 @@ fn direct_writes() -> bool {
|
||||
pub(crate) fn write_mapped(dst: *mut u8, src: *const u8, len: usize) {
|
||||
use windows_sys::Win32::System::Diagnostics::Debug::WriteProcessMemory;
|
||||
use windows_sys::Win32::System::Threading::GetCurrentProcess;
|
||||
crate::watch::materialize(dst as usize, len);
|
||||
let direct = direct_writes();
|
||||
let since = crate::watch::changes();
|
||||
let write = |at: usize, n: usize| {
|
||||
|
||||
Reference in new issue
Block a user