mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-24 19:58:45 +08:00
Fix Linux aligned mapping retention (#247)
* Fix Linux aligned mapping retention * Cover Linux aligned mapping retention
This commit is contained in:
@@ -349,10 +349,8 @@ public sealed unsafe class PhysicalVirtualMemory : IVirtualMemory, IGuestMemoryA
|
||||
var requestedCursor = AlignUp(desiredAddress, effectiveAlignment);
|
||||
var cursor = GetAllocationSearchCursor(desiredAddress, requestedCursor, effectiveAlignment, executable);
|
||||
|
||||
// POSIX treats the requested address as a hint, and Rosetta may
|
||||
// relocate whole guest windows. Over-allocate once so the returned
|
||||
// host range always contains an aligned guest-visible start.
|
||||
if (!OperatingSystem.IsWindows())
|
||||
// macOS needs alignment over-allocation; Linux uses exact-address search.
|
||||
if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
var reserveSize = effectiveAlignment > PageSize
|
||||
? alignedSize + effectiveAlignment
|
||||
|
||||
Reference in New Issue
Block a user