diff options
| author | Narr the Reg <juangerman-13@hotmail.com> | 2024-01-01 13:56:16 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-01 13:56:16 -0600 |
| commit | f0f92edbd0a78abda819251ddc325da4acc14216 (patch) | |
| tree | 6a23c1be26148c4137a6f67ebdf926a3f82ce47f /src/common/host_memory.h | |
| parent | 4d49f095b3bee2a417b462f675d398d563b5b37d (diff) | |
| parent | adb2af0a2ba1285312484ca279903686c4676121 (diff) | |
Merge pull request #12466 from liamwhite/sh2
core: track separate heap allocation for linux
Diffstat (limited to 'src/common/host_memory.h')
| -rw-r--r-- | src/common/host_memory.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/common/host_memory.h b/src/common/host_memory.h index 747c5850c..72fbb05af 100644 --- a/src/common/host_memory.h +++ b/src/common/host_memory.h @@ -40,11 +40,12 @@ public: HostMemory(HostMemory&& other) noexcept; HostMemory& operator=(HostMemory&& other) noexcept; - void Map(size_t virtual_offset, size_t host_offset, size_t length, MemoryPermission perms); + void Map(size_t virtual_offset, size_t host_offset, size_t length, MemoryPermission perms, + bool separate_heap); - void Unmap(size_t virtual_offset, size_t length); + void Unmap(size_t virtual_offset, size_t length, bool separate_heap); - void Protect(size_t virtual_offset, size_t length, bool read, bool write, bool execute = false); + void Protect(size_t virtual_offset, size_t length, MemoryPermission perms); void EnableDirectMappedAddress(); @@ -64,6 +65,10 @@ public: return virtual_base; } + bool IsInVirtualRange(void* address) const noexcept { + return address >= virtual_base && address < virtual_base + virtual_size; + } + private: size_t backing_size{}; size_t virtual_size{}; |
