summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/vm_manager.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-11-13 17:06:33 +0100
committerLioncash <mathew1800@gmail.com>2018-11-13 19:08:19 +0100
commitb8e885c6e5de880d68e9b43480ee6f6423375b09 (patch)
tree9893b285c0dc75fc8bc61a1c7568789e84c6c72f /src/core/hle/kernel/vm_manager.h
parentMerge pull request #1628 from greggameplayer/Texture2DArray (diff)
downloadyuzu-b8e885c6e5de880d68e9b43480ee6f6423375b09.tar
yuzu-b8e885c6e5de880d68e9b43480ee6f6423375b09.tar.gz
yuzu-b8e885c6e5de880d68e9b43480ee6f6423375b09.tar.bz2
yuzu-b8e885c6e5de880d68e9b43480ee6f6423375b09.tar.lz
yuzu-b8e885c6e5de880d68e9b43480ee6f6423375b09.tar.xz
yuzu-b8e885c6e5de880d68e9b43480ee6f6423375b09.tar.zst
yuzu-b8e885c6e5de880d68e9b43480ee6f6423375b09.zip
Diffstat (limited to 'src/core/hle/kernel/vm_manager.h')
-rw-r--r--src/core/hle/kernel/vm_manager.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/hle/kernel/vm_manager.h b/src/core/hle/kernel/vm_manager.h
index 2447cbb8f..248cc46dc 100644
--- a/src/core/hle/kernel/vm_manager.h
+++ b/src/core/hle/kernel/vm_manager.h
@@ -186,6 +186,11 @@ public:
/// Changes the permissions of a range of addresses, splitting VMAs as necessary.
ResultCode ReprotectRange(VAddr target, u64 size, VMAPermission new_perms);
+ ResultVal<VAddr> HeapAllocate(VAddr target, u64 size, VMAPermission perms);
+ ResultCode HeapFree(VAddr target, u64 size);
+
+ ResultCode MirrorMemory(VAddr dst_addr, VAddr src_addr, u64 size);
+
/**
* Scans all VMAs and updates the page table range of any that use the given vector as backing
* memory. This should be called after any operation that causes reallocation of the vector.
@@ -343,5 +348,15 @@ private:
VAddr tls_io_region_base = 0;
VAddr tls_io_region_end = 0;
+
+ // Memory used to back the allocations in the regular heap. A single vector is used to cover
+ // the entire virtual address space extents that bound the allocations, including any holes.
+ // This makes deallocation and reallocation of holes fast and keeps process memory contiguous
+ // in the emulator address space, allowing Memory::GetPointer to be reasonably safe.
+ std::shared_ptr<std::vector<u8>> heap_memory;
+ // The left/right bounds of the address space covered by heap_memory.
+ VAddr heap_start = 0;
+ VAddr heap_end = 0;
+ u64 heap_used = 0;
};
} // namespace Kernel