aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/process.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
-rw-r--r--src/core/hle/kernel/process.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index 124047a53..c2b4963d4 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -129,7 +129,7 @@ void Process::Run(s32 main_thread_priority, u32 stack_size) {
}
VAddr Process::GetLinearHeapBase() const {
- return (kernel_version < 0x22C ? Memory::LINEAR_HEAP_VADDR : Memory::NEW_LINEAR_HEAP_SIZE)
+ return (kernel_version < 0x22C ? Memory::LINEAR_HEAP_VADDR : Memory::NEW_LINEAR_HEAP_VADDR)
+ memory_region->base;
}
@@ -174,6 +174,10 @@ ResultCode Process::HeapFree(VAddr target, u32 size) {
return ERR_INVALID_ADDRESS;
}
+ if (size == 0) {
+ return RESULT_SUCCESS;
+ }
+
ResultCode result = vm_manager.UnmapRange(target, size);
if (result.IsError()) return result;
@@ -226,6 +230,10 @@ ResultCode Process::LinearFree(VAddr target, u32 size) {
return ERR_INVALID_ADDRESS;
}
+ if (size == 0) {
+ return RESULT_SUCCESS;
+ }
+
VAddr heap_end = GetLinearHeapBase() + (u32)linheap_memory->size();
if (target + size > heap_end) {
return ERR_INVALID_ADDRESS_STATE;