diff options
author | Lioncash <mathew1800@gmail.com> | 2019-03-24 20:24:52 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-03-24 21:17:31 +0100 |
commit | 586cab617270346c39ecfb340127e0b8edb863d3 (patch) | |
tree | 47daaae2ad06629fc4c636746cc39b6818441425 /src/core/hle/kernel/vm_manager.h | |
parent | Merge pull request #2221 from DarkLordZach/firmware-version (diff) | |
download | yuzu-586cab617270346c39ecfb340127e0b8edb863d3.tar yuzu-586cab617270346c39ecfb340127e0b8edb863d3.tar.gz yuzu-586cab617270346c39ecfb340127e0b8edb863d3.tar.bz2 yuzu-586cab617270346c39ecfb340127e0b8edb863d3.tar.lz yuzu-586cab617270346c39ecfb340127e0b8edb863d3.tar.xz yuzu-586cab617270346c39ecfb340127e0b8edb863d3.tar.zst yuzu-586cab617270346c39ecfb340127e0b8edb863d3.zip |
Diffstat (limited to 'src/core/hle/kernel/vm_manager.h')
-rw-r--r-- | src/core/hle/kernel/vm_manager.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/core/hle/kernel/vm_manager.h b/src/core/hle/kernel/vm_manager.h index 7cdff6094..23edd6582 100644 --- a/src/core/hle/kernel/vm_manager.h +++ b/src/core/hle/kernel/vm_manager.h @@ -380,7 +380,7 @@ 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); + ResultVal<VAddr> HeapAllocate(u64 size); ResultCode HeapFree(VAddr target, u64 size); ResultCode MirrorMemory(VAddr dst_addr, VAddr src_addr, u64 size, MemoryState state); @@ -469,6 +469,13 @@ public: /// Gets the total size of the heap region in bytes. u64 GetHeapRegionSize() const; + /// Gets the total size of the current heap in bytes. + /// + /// @note This is the current allocated heap size, not the size + /// of the region it's allowed to exist within. + /// + u64 GetCurrentHeapSize() const; + /// Determines whether or not the specified range is within the heap region. bool IsWithinHeapRegion(VAddr address, u64 size) const; @@ -628,9 +635,12 @@ private: // 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; + + // The end of the currently allocated heap. This is not an inclusive + // end of the range. This is essentially 'base_address + current_size'. VAddr heap_end = 0; + + // Indicates how many bytes from the current heap are currently used. u64 heap_used = 0; }; } // namespace Kernel |