mirror of
https://github.com/par274/sharpemu.git
synced 2026-08-30 21:31:57 +08:00
fix(memory): expand the HLE guest-allocation arena (#843)
Co-authored-by: Foued Attar <foued.attar@lyceeastier.com>
This commit is contained in:
@@ -14,7 +14,7 @@ public sealed class GuestMemoryAllocatorTests
|
||||
public void FreedRangesAreReusedAndCoalesced()
|
||||
{
|
||||
using var memory = new PhysicalVirtualMemory(new FakeHostMemory());
|
||||
const ulong usableArenaSize = 0x0100_0000 - 0x1000;
|
||||
const ulong usableArenaSize = 0x2000_0000 - 0x1000;
|
||||
|
||||
Assert.True(memory.TryAllocateGuestMemory(0x4000, 0x1000, out var first));
|
||||
Assert.True(memory.TryAllocateGuestMemory(0x8000, 0x1000, out var second));
|
||||
@@ -34,6 +34,16 @@ public sealed class GuestMemoryAllocatorTests
|
||||
Assert.Equal(first, coalesced);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ArenaSupportsAllocationsBeyondLegacySixteenMiBLimit()
|
||||
{
|
||||
using var memory = new PhysicalVirtualMemory(new FakeHostMemory());
|
||||
|
||||
Assert.True(memory.TryAllocateGuestMemory(0x0100_0000, 0x1000, out var first));
|
||||
Assert.True(memory.TryAllocateGuestMemory(0x0020_0000, 0x1000, out var beyondLegacyLimit));
|
||||
Assert.Equal(first + 0x0100_0000, beyondLegacyLimit);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SegmentProtectionIsAppliedInContiguousRuns()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user