summaryrefslogtreecommitdiffstats
path: root/src/common/host_memory.cpp
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2024-01-01 20:56:16 +0100
committerGitHub <noreply@github.com>2024-01-01 20:56:16 +0100
commitf0f92edbd0a78abda819251ddc325da4acc14216 (patch)
tree6a23c1be26148c4137a6f67ebdf926a3f82ce47f /src/common/host_memory.cpp
parentMerge pull request #12501 from liamwhite/ips (diff)
parentheap_tracker: use linear-time mapping eviction (diff)
downloadyuzu-f0f92edbd0a78abda819251ddc325da4acc14216.tar
yuzu-f0f92edbd0a78abda819251ddc325da4acc14216.tar.gz
yuzu-f0f92edbd0a78abda819251ddc325da4acc14216.tar.bz2
yuzu-f0f92edbd0a78abda819251ddc325da4acc14216.tar.lz
yuzu-f0f92edbd0a78abda819251ddc325da4acc14216.tar.xz
yuzu-f0f92edbd0a78abda819251ddc325da4acc14216.tar.zst
yuzu-f0f92edbd0a78abda819251ddc325da4acc14216.zip
Diffstat (limited to 'src/common/host_memory.cpp')
-rw-r--r--src/common/host_memory.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp
index e540375b8..860c39e6a 100644
--- a/src/common/host_memory.cpp
+++ b/src/common/host_memory.cpp
@@ -679,7 +679,7 @@ HostMemory::HostMemory(HostMemory&&) noexcept = default;
HostMemory& HostMemory::operator=(HostMemory&&) noexcept = default;
void HostMemory::Map(size_t virtual_offset, size_t host_offset, size_t length,
- MemoryPermission perms) {
+ MemoryPermission perms, bool separate_heap) {
ASSERT(virtual_offset % PageAlignment == 0);
ASSERT(host_offset % PageAlignment == 0);
ASSERT(length % PageAlignment == 0);
@@ -691,7 +691,7 @@ void HostMemory::Map(size_t virtual_offset, size_t host_offset, size_t length,
impl->Map(virtual_offset + virtual_base_offset, host_offset, length, perms);
}
-void HostMemory::Unmap(size_t virtual_offset, size_t length) {
+void HostMemory::Unmap(size_t virtual_offset, size_t length, bool separate_heap) {
ASSERT(virtual_offset % PageAlignment == 0);
ASSERT(length % PageAlignment == 0);
ASSERT(virtual_offset + length <= virtual_size);
@@ -701,14 +701,16 @@ void HostMemory::Unmap(size_t virtual_offset, size_t length) {
impl->Unmap(virtual_offset + virtual_base_offset, length);
}
-void HostMemory::Protect(size_t virtual_offset, size_t length, bool read, bool write,
- bool execute) {
+void HostMemory::Protect(size_t virtual_offset, size_t length, MemoryPermission perm) {
ASSERT(virtual_offset % PageAlignment == 0);
ASSERT(length % PageAlignment == 0);
ASSERT(virtual_offset + length <= virtual_size);
if (length == 0 || !virtual_base || !impl) {
return;
}
+ const bool read = True(perm & MemoryPermission::Read);
+ const bool write = True(perm & MemoryPermission::Write);
+ const bool execute = True(perm & MemoryPermission::Execute);
impl->Protect(virtual_offset + virtual_base_offset, length, read, write, execute);
}