diff options
author | Liam <byteslice@airmail.cc> | 2023-12-26 05:21:08 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-12-26 05:30:56 +0100 |
commit | ddda76f9b0d16e8a6fbc92db9e26f25843b647ed (patch) | |
tree | 3fd209d66b8503ca7f0cf6d15c5c065179c66076 /src/common/host_memory.h | |
parent | Merge pull request #12394 from liamwhite/per-process-memory (diff) | |
download | yuzu-ddda76f9b0d16e8a6fbc92db9e26f25843b647ed.tar yuzu-ddda76f9b0d16e8a6fbc92db9e26f25843b647ed.tar.gz yuzu-ddda76f9b0d16e8a6fbc92db9e26f25843b647ed.tar.bz2 yuzu-ddda76f9b0d16e8a6fbc92db9e26f25843b647ed.tar.lz yuzu-ddda76f9b0d16e8a6fbc92db9e26f25843b647ed.tar.xz yuzu-ddda76f9b0d16e8a6fbc92db9e26f25843b647ed.tar.zst yuzu-ddda76f9b0d16e8a6fbc92db9e26f25843b647ed.zip |
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{}; |