diff options
author | Lioncash <mathew1800@gmail.com> | 2018-09-06 20:34:51 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-09-06 20:52:58 -0400 |
commit | 3f17fe71334a27a60bf54adc55eabe2356ed31f5 (patch) | |
tree | 11fd2e48608908feb95c9024e3bd8e1267ec538a /src/core/hle/kernel/kernel.h | |
parent | a164b413fa479ec1ab0322044ca5ce6c16708e3a (diff) |
core: Migrate current_process pointer to the kernel
Given we now have the kernel as a class, it doesn't make sense to keep
the current process pointer within the System class, as processes are
related to the kernel.
This also gets rid of a subtle case where memory wouldn't be freed on
core shutdown, as the current_process pointer would never be reset,
causing the pointed to contents to continue to live.
Diffstat (limited to 'src/core/hle/kernel/kernel.h')
-rw-r--r-- | src/core/hle/kernel/kernel.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index ab2e9bffa1..c0771ecf07 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -65,6 +65,15 @@ public: /// Adds the given shared pointer to an internal list of active processes. void AppendNewProcess(SharedPtr<Process> process); + /// Makes the given process the new current process. + void MakeCurrentProcess(SharedPtr<Process> process); + + /// Retrieves a reference to the current process. + SharedPtr<Process>& CurrentProcess(); + + /// Retrieves a const reference to the current process. + const SharedPtr<Process>& CurrentProcess() const; + /// Adds a port to the named port table void AddNamedPort(std::string name, SharedPtr<ClientPort> port); |