diff options
author | Lioncash <mathew1800@gmail.com> | 2019-03-24 20:56:07 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-03-24 22:08:16 +0100 |
commit | 52980df1aa796bb1eba3e5fec921eab1df961e51 (patch) | |
tree | 14b1869e4dd7ebed81ce361c4100ad1f8a8e1887 /src/core/hle/kernel | |
parent | kernel/vm_manager: Tidy up heap allocation code (diff) | |
download | yuzu-52980df1aa796bb1eba3e5fec921eab1df961e51.tar yuzu-52980df1aa796bb1eba3e5fec921eab1df961e51.tar.gz yuzu-52980df1aa796bb1eba3e5fec921eab1df961e51.tar.bz2 yuzu-52980df1aa796bb1eba3e5fec921eab1df961e51.tar.lz yuzu-52980df1aa796bb1eba3e5fec921eab1df961e51.tar.xz yuzu-52980df1aa796bb1eba3e5fec921eab1df961e51.tar.zst yuzu-52980df1aa796bb1eba3e5fec921eab1df961e51.zip |
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r-- | src/core/hle/kernel/svc.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/kernel/vm_manager.cpp | 7 | ||||
-rw-r--r-- | src/core/hle/kernel/vm_manager.h | 6 |
3 files changed, 2 insertions, 13 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 59bc8d9f8..f689f745f 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -806,7 +806,7 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) return RESULT_SUCCESS; case GetInfoType::TotalHeapUsage: - *result = process->VMManager().GetTotalHeapUsage(); + *result = process->VMManager().GetCurrentHeapSize(); return RESULT_SUCCESS; case GetInfoType::IsVirtualAddressMemoryEnabled: diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index 9848a8ac6..04d58bbf7 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -285,7 +285,6 @@ ResultVal<VAddr> VMManager::HeapAllocate(u64 size) { return mapping_result.Code(); } - heap_used = size; return MakeResult<VAddr>(heap_region_base); } @@ -303,7 +302,6 @@ ResultCode VMManager::HeapFree(VAddr target, u64 size) { return result; } - heap_used -= size; return RESULT_SUCCESS; } @@ -596,6 +594,7 @@ void VMManager::InitializeMemoryRegionRanges(FileSys::ProgramAddressSpaceType ty heap_region_base = map_region_end; heap_region_end = heap_region_base + heap_region_size; + heap_end = heap_region_base; new_map_region_base = heap_region_end; new_map_region_end = new_map_region_base + new_map_region_size; @@ -690,10 +689,6 @@ u64 VMManager::GetTotalMemoryUsage() const { return 0xF8000000; } -u64 VMManager::GetTotalHeapUsage() const { - return heap_used; -} - VAddr VMManager::GetAddressSpaceBaseAddress() const { return address_space_base; } diff --git a/src/core/hle/kernel/vm_manager.h b/src/core/hle/kernel/vm_manager.h index 23edd6582..cb864ab31 100644 --- a/src/core/hle/kernel/vm_manager.h +++ b/src/core/hle/kernel/vm_manager.h @@ -418,9 +418,6 @@ public: /// Gets the total memory usage, used by svcGetInfo u64 GetTotalMemoryUsage() const; - /// Gets the total heap usage, used by svcGetInfo - u64 GetTotalHeapUsage() const; - /// Gets the address space base address VAddr GetAddressSpaceBaseAddress() const; @@ -639,8 +636,5 @@ private: // 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 |