summaryrefslogtreecommitdiff
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2019-11-26 12:33:20 -0500
committerGravatar Lioncash2019-11-26 21:53:34 -0500
commit4c2ed2706e3579ec1304907dad0d45673768e1fc (patch)
tree89f72c13ad6ab374a4e2d2d475b1e03320de7066 /src/core/memory.cpp
parentMerge pull request #3143 from ReinUsesLisp/indexing-bug (diff)
downloadyuzu-4c2ed2706e3579ec1304907dad0d45673768e1fc.tar.gz
yuzu-4c2ed2706e3579ec1304907dad0d45673768e1fc.tar.xz
yuzu-4c2ed2706e3579ec1304907dad0d45673768e1fc.zip
core/memory: Introduce skeleton of Memory class
Currently, the main memory management code is one of the remaining places where we have global state. The next series of changes will aim to rectify this. This change simply introduces the main skeleton of the class that will contain all the necessary state.
Diffstat (limited to 'src/core/memory.cpp')
-rw-r--r--src/core/memory.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index fa49f3dd0..2098f13f7 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -24,6 +24,18 @@ namespace Memory {
24 24
25static Common::PageTable* current_page_table = nullptr; 25static Common::PageTable* current_page_table = nullptr;
26 26
27// Implementation class used to keep the specifics of the memory subsystem hidden
28// from outside classes. This also allows modification to the internals of the memory
29// subsystem without needing to rebuild all files that make use of the memory interface.
30struct Memory::Impl {
31 explicit Impl(Core::System& system_) : system{system_} {}
32
33 Core::System& system;
34};
35
36Memory::Memory(Core::System& system) : impl{std::make_unique<Impl>(system)} {}
37Memory::~Memory() = default;
38
27void SetCurrentPageTable(Kernel::Process& process) { 39void SetCurrentPageTable(Kernel::Process& process) {
28 current_page_table = &process.VMManager().page_table; 40 current_page_table = &process.VMManager().page_table;
29 41