Use bigger memory blocks for GiantBlock

When using GiantBlock the memory block used for filling SparseMemoryBlocks is now 4096 times bigger.
Cuts function table mapping times by a factor of about 5000
This commit is contained in:
LotP1 2024-11-17 23:11:47 +01:00 committed by LotP1
parent 7ddcbe30f3
commit 206a66464c

View File

@ -137,7 +137,7 @@ namespace ARMeilleure.Common
/// <param name="sparse">True if the bottom page should be sparsely mapped</param> /// <param name="sparse">True if the bottom page should be sparsely mapped</param>
/// <exception cref="ArgumentNullException"><paramref name="levels"/> is null</exception> /// <exception cref="ArgumentNullException"><paramref name="levels"/> is null</exception>
/// <exception cref="ArgumentException">Length of <paramref name="levels"/> is less than 2</exception> /// <exception cref="ArgumentException">Length of <paramref name="levels"/> is less than 2</exception>
public AddressTable(AddressTableLevel[] levels, bool sparse) public AddressTable(AddressTableLevel[] levels, bool sparse, bool lowPower)
{ {
ArgumentNullException.ThrowIfNull(levels); ArgumentNullException.ThrowIfNull(levels);
@ -157,7 +157,7 @@ namespace ARMeilleure.Common
{ {
// If the address table is sparse, allocate a fill block // If the address table is sparse, allocate a fill block
_sparseFill = new MemoryBlock(65536, MemoryAllocationFlags.Mirrorable); _sparseFill = new MemoryBlock(lowPower ? 65536ul : 268435456ul, MemoryAllocationFlags.Mirrorable);
ulong bottomLevelSize = (1ul << levels.Last().Length) * (ulong)sizeof(TEntry); ulong bottomLevelSize = (1ul << levels.Last().Length) * (ulong)sizeof(TEntry);
@ -183,7 +183,7 @@ namespace ARMeilleure.Common
// Assume software memory means that we don't want to use any signal handlers. // Assume software memory means that we don't want to use any signal handlers.
bool sparse = type != MemoryManagerType.SoftwareMmu && type != MemoryManagerType.SoftwarePageTable; bool sparse = type != MemoryManagerType.SoftwareMmu && type != MemoryManagerType.SoftwarePageTable;
return new AddressTable<TEntry>(AddressTablePresets.GetArmPreset(for64Bits, sparse, lowPower), sparse); return new AddressTable<TEntry>(AddressTablePresets.GetArmPreset(for64Bits, sparse, lowPower), sparse, lowPower);
} }
/// <summary> /// <summary>