diff --git a/src/xenia/memory.cc b/src/xenia/memory.cc index 516c155e6..9636b38e7 100644 --- a/src/xenia/memory.cc +++ b/src/xenia/memory.cc @@ -1100,10 +1100,15 @@ bool BaseHeap::QueryRegionInfo(uint32_t base_address, // Committed/reserved region. out_info->allocation_base = start_page_entry.base_address * page_size_; out_info->allocation_protect = start_page_entry.allocation_protect; + out_info->allocation_size = start_page_entry.region_page_count * page_size_; out_info->state = start_page_entry.state; out_info->protect = start_page_entry.current_protect; + + // Scan forward and report the size of the region matching the initial + // base address's attributes. for (uint32_t page_number = start_page_number; - page_number < start_page_number + start_page_entry.region_page_count; + page_number < + start_page_entry.base_address + start_page_entry.region_page_count; ++page_number) { auto page_entry = page_table_[page_number]; if (page_entry.base_address != start_page_entry.base_address || diff --git a/src/xenia/memory.h b/src/xenia/memory.h index 8f5e3b535..64f8c57e9 100644 --- a/src/xenia/memory.h +++ b/src/xenia/memory.h @@ -56,6 +56,8 @@ struct HeapAllocationInfo { uint32_t allocation_base; // The memory protection option when the region was initially allocated. uint32_t allocation_protect; + // The size specified when the region was initially allocated, in bytes. + uint32_t allocation_size; // The size of the region beginning at the base address in which all pages // have identical attributes, in bytes. uint32_t region_size;