summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/process.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-03-16 23:24:29 +0100
committerbunnei <bunneidev@gmail.com>2018-03-16 23:32:25 +0100
commite9a857ce82e85c3933f6ce3140ba366e932db386 (patch)
treef40d3990e9194180d378c1d25a484d9be93e96f5 /src/core/hle/kernel/process.cpp
parentarm_interface: Support unmapping previously mapped memory. (diff)
downloadyuzu-e9a857ce82e85c3933f6ce3140ba366e932db386.tar
yuzu-e9a857ce82e85c3933f6ce3140ba366e932db386.tar.gz
yuzu-e9a857ce82e85c3933f6ce3140ba366e932db386.tar.bz2
yuzu-e9a857ce82e85c3933f6ce3140ba366e932db386.tar.lz
yuzu-e9a857ce82e85c3933f6ce3140ba366e932db386.tar.xz
yuzu-e9a857ce82e85c3933f6ce3140ba366e932db386.tar.zst
yuzu-e9a857ce82e85c3933f6ce3140ba366e932db386.zip
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
-rw-r--r--src/core/hle/kernel/process.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index 5711b5247..c1a883b3c 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -183,6 +183,8 @@ ResultVal<VAddr> Process::HeapAllocate(VAddr target, u64 size, VMAPermission per
// Initialize heap
heap_memory = std::make_shared<std::vector<u8>>();
heap_start = heap_end = target;
+ } else {
+ vm_manager.UnmapRange(heap_start, heap_end - heap_start);
}
// If necessary, expand backing vector to cover new heap extents.
@@ -202,7 +204,7 @@ ResultVal<VAddr> Process::HeapAllocate(VAddr target, u64 size, VMAPermission per
size, MemoryState::Heap));
vm_manager.Reprotect(vma, perms);
- heap_used += size;
+ heap_used = size;
memory_region->used += size;
return MakeResult<VAddr>(heap_end - size);