Limit unspecified virtual allocation only to 3/4 of heap

This commit is contained in:
Gliniak 2021-08-03 12:14:48 +02:00
parent c20c7c930c
commit 498dde6e1a
1 changed files with 3 additions and 1 deletions

View File

@ -831,7 +831,9 @@ bool BaseHeap::Alloc(uint32_t size, uint32_t alignment,
size = xe::round_up(size, page_size_); size = xe::round_up(size, page_size_);
alignment = xe::round_up(alignment, page_size_); alignment = xe::round_up(alignment, page_size_);
uint32_t low_address = heap_base_; 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, return AllocRange(low_address, high_address, size, alignment, allocation_type,
protect, top_down, out_address); protect, top_down, out_address);
} }