From 498dde6e1ad44383dc5155110bdbc6945335e82a Mon Sep 17 00:00:00 2001 From: Gliniak Date: Tue, 3 Aug 2021 12:14:48 +0200 Subject: [PATCH] Limit unspecified virtual allocation only to 3/4 of heap --- src/xenia/memory.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xenia/memory.cc b/src/xenia/memory.cc index 1e342dfc9..2b48091d3 100644 --- a/src/xenia/memory.cc +++ b/src/xenia/memory.cc @@ -831,7 +831,9 @@ bool BaseHeap::Alloc(uint32_t size, uint32_t alignment, size = xe::round_up(size, page_size_); alignment = xe::round_up(alignment, page_size_); uint32_t low_address = heap_base_; - uint32_t high_address = heap_base_ + (heap_size_ - 1); + uint32_t high_address = + heap_base_ + (heap_size_ - 1) - + (heap_type_ == HeapType::kGuestVirtual ? 0x10000000 : 0); return AllocRange(low_address, high_address, size, alignment, allocation_type, protect, top_down, out_address); }