From 27cbb75e7c2818c073bd65a000d7ff7f28d391d4 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Fri, 13 Mar 2020 16:33:47 -0400 Subject: PageTable: move backing addresses to a children class as the CPU page table does not need them. This PR aims to reduce the memory usage in the CPU page table by moving GPU specific parameters into a child class. This saves 1Gb of Memory for most games. --- src/common/page_table.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/common/page_table.h') diff --git a/src/common/page_table.h b/src/common/page_table.h index 8b8ff0bb8..dbc272ab7 100644 --- a/src/common/page_table.h +++ b/src/common/page_table.h @@ -76,9 +76,20 @@ struct PageTable { */ std::vector attributes; - std::vector backing_addr; - const std::size_t page_size_in_bits{}; }; +/** + * A more advanced Page Table with the ability to save a backing address when using it + * depends on another MMU. + */ +struct BackingPageTable : PageTable { + explicit BackingPageTable(std::size_t page_size_in_bits); + ~BackingPageTable(); + + void Resize(std::size_t address_space_width_in_bits); + + std::vector backing_addr; +}; + } // namespace Common -- cgit v1.2.3