mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-05 13:20:11 +00:00
A sparse heap mirror, made for a heap with uncommitted pages, is refreshed from the write watch through its committed pieces. The check that a reused heap mirror's range is still watched covered the heap mirrors acquireMirror reuses and the cached space's heap runs, not sparse ones: once a committed piece left the watch, refreshSparseMirror threw "a sparse heap mirror's range is no longer write-watched" from acquireMirror's reuse and from a cache hit's sparse refresh. refreshSparseMirror now returns false when a piece is no longer watched. Both callers already take false as not reusable: acquireMirror makes the mirror again, finds the range unwatched, drops the stale mirror and leaves the range to a copy, and a cache hit gives up the cached space. agc_sparse_heap_mirror_unwatch mirrors a 1 MiB reservation with 256 KiB committed, takes one committed block off the write watch and stores new bytes there from the CPU; the next build must not reuse the mirror and must serve the new bytes. agc_sparse_heap_mirror_unwatch_no_space_cache runs the same without the address-space cache. Without the fix both throw. They are registered on Linux; the Windows path uses the guest arena as the existing sparse heap test does and has not run on Windows.