common: Enhance memory mapping safety and debugging

- Reduce max_memory_size from 512GB to 1GB for safer allocation limits
- Add memory operation logging for debugging purposes
- Implement MapMemory() with additional safety checks and large allocation handling
- Add validation checks for memory mappings
- Introduce chunked allocation strategy for large memory requests
- Add detailed error logging for memory operations
This commit is contained in:
Zephyron 2025-02-09 15:40:24 +10:00
parent becaf850ab
commit 5af4803e42
No known key found for this signature in database
2 changed files with 100 additions and 1 deletions

View file

@ -52,6 +52,13 @@ public:
void ClearBackingRegion(size_t physical_offset, size_t length, u32 fill_value);
/// Attempts to map memory with additional safety checks and chunking for large allocations
/// @param virtual_offset The virtual memory address to map to
/// @param host_offset The physical memory address to map from
/// @param length The size of the mapping in bytes
/// @return true if mapping succeeded, false if it failed
bool MapMemory(uint64_t virtual_offset, uint64_t host_offset, uint64_t length);
[[nodiscard]] u8* BackingBasePointer() noexcept {
return backing_base;
}