summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2019-03-24 16:28:04 -0400
committerGravatar Lioncash2019-03-24 17:08:30 -0400
commit99a163478be9ca285280ee59aa7800903b8571c2 (patch)
tree68d92d914872bd772cb5e2daa2cf3a5c2f1d0295 /src
parentkernel/vm_manager: Handle case of identical calls to HeapAllocate (diff)
downloadyuzu-99a163478be9ca285280ee59aa7800903b8571c2.tar.gz
yuzu-99a163478be9ca285280ee59aa7800903b8571c2.tar.xz
yuzu-99a163478be9ca285280ee59aa7800903b8571c2.zip
kernel/vm_manager: Rename HeapAllocate to SetHeapSize
Makes it more obvious that this function is intending to stand in for the actual supervisor call itself, and not acting as a general heap allocation function. Also the following change will merge the freeing behavior of HeapFree into this function, so leaving it as HeapAllocate would be misleading.
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/svc.cpp3
-rw-r--r--src/core/hle/kernel/vm_manager.cpp2
-rw-r--r--src/core/hle/kernel/vm_manager.h2
3 files changed, 3 insertions, 4 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index f689f745f..6a8960c8d 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -175,8 +175,7 @@ static ResultCode SetHeapSize(VAddr* heap_addr, u64 heap_size) {
175 } 175 }
176 176
177 auto& vm_manager = Core::System::GetInstance().Kernel().CurrentProcess()->VMManager(); 177 auto& vm_manager = Core::System::GetInstance().Kernel().CurrentProcess()->VMManager();
178 const auto alloc_result = vm_manager.HeapAllocate(heap_size); 178 const auto alloc_result = vm_manager.SetHeapSize(heap_size);
179
180 if (alloc_result.Failed()) { 179 if (alloc_result.Failed()) {
181 return alloc_result.Code(); 180 return alloc_result.Code();
182 } 181 }
diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp
index 16f48471e..523fe63e9 100644
--- a/src/core/hle/kernel/vm_manager.cpp
+++ b/src/core/hle/kernel/vm_manager.cpp
@@ -256,7 +256,7 @@ ResultCode VMManager::ReprotectRange(VAddr target, u64 size, VMAPermission new_p
256 return RESULT_SUCCESS; 256 return RESULT_SUCCESS;
257} 257}
258 258
259ResultVal<VAddr> VMManager::HeapAllocate(u64 size) { 259ResultVal<VAddr> VMManager::SetHeapSize(u64 size) {
260 if (size > GetHeapRegionSize()) { 260 if (size > GetHeapRegionSize()) {
261 return ERR_OUT_OF_MEMORY; 261 return ERR_OUT_OF_MEMORY;
262 } 262 }
diff --git a/src/core/hle/kernel/vm_manager.h b/src/core/hle/kernel/vm_manager.h
index ac5c33087..cab748364 100644
--- a/src/core/hle/kernel/vm_manager.h
+++ b/src/core/hle/kernel/vm_manager.h
@@ -380,7 +380,7 @@ public:
380 /// Changes the permissions of a range of addresses, splitting VMAs as necessary. 380 /// Changes the permissions of a range of addresses, splitting VMAs as necessary.
381 ResultCode ReprotectRange(VAddr target, u64 size, VMAPermission new_perms); 381 ResultCode ReprotectRange(VAddr target, u64 size, VMAPermission new_perms);
382 382
383 ResultVal<VAddr> HeapAllocate(u64 size); 383 ResultVal<VAddr> SetHeapSize(u64 size);
384 ResultCode HeapFree(VAddr target, u64 size); 384 ResultCode HeapFree(VAddr target, u64 size);
385 385
386 ResultCode MirrorMemory(VAddr dst_addr, VAddr src_addr, u64 size, MemoryState state); 386 ResultCode MirrorMemory(VAddr dst_addr, VAddr src_addr, u64 size, MemoryState state);