diff --git a/src/xenia/memory.cc b/src/xenia/memory.cc index f1a1e32f7..9c9b7af43 100644 --- a/src/xenia/memory.cc +++ b/src/xenia/memory.cc @@ -1044,17 +1044,12 @@ bool BaseHeap::Alloc(uint32_t size, uint32_t alignment, size = xe::round_up(size, page_size_); alignment = xe::round_up(alignment, page_size_); - // TODO(Gliniak): Find better way to deal with this! - // Because 0x3XXXXXX and 0x7XXXXXX is used strictly as place for thread stacks - // 0x3 is probably for system threads and 0x7 for title threads + // Exclude the top 240MB of the v40000000 heap (64KB guest pages) from + // general allocation to protect the thread stack region + // (0x70000000-0x7F000000) uint32_t heap_virtual_guest_offset = 0; - if (heap_type_ == HeapType::kGuestVirtual) { - heap_virtual_guest_offset = 0x10000000; - - // Adjust for 64k pages region, to prevent having a bit too little memory - if (page_size_ == 0x10000) { - heap_virtual_guest_offset = 0x0F000000; - } + if (heap_type_ == HeapType::kGuestVirtual && page_size_ == 0x10000) { + heap_virtual_guest_offset = 0x0F000000; } uint32_t low_address = heap_base_;