diff options
| author | Subv <subv2112@gmail.com> | 2018-02-27 10:22:15 -0500 |
|---|---|---|
| committer | Subv <subv2112@gmail.com> | 2018-03-01 19:03:53 -0500 |
| commit | 827f8ca3c77ad0b7e667c64b5c983b3b3ffe8d7d (patch) | |
| tree | e557f60eddcd74f0ab380a81dd42749b3e46ef4e /src/core/hle/kernel/process.cpp | |
| parent | cc6e4ae6cf496f787c5277135aaa3e63cb98b780 (diff) | |
Kernel: Store the program id in the Process class instead of the CodeSet class.
There may be many CodeSets per Process, so it's wasteful and overcomplicated to store the program id in each of them.
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 8e74059ea..bb6dc28d7 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -20,12 +20,9 @@ namespace Kernel { // Lists all processes that exist in the current session. static std::vector<SharedPtr<Process>> process_list; -SharedPtr<CodeSet> CodeSet::Create(std::string name, u64 program_id) { +SharedPtr<CodeSet> CodeSet::Create(std::string name) { SharedPtr<CodeSet> codeset(new CodeSet); - codeset->name = std::move(name); - codeset->program_id = program_id; - return codeset; } @@ -34,13 +31,14 @@ CodeSet::~CodeSet() {} u32 Process::next_process_id; -SharedPtr<Process> Process::Create(std::string&& name) { +SharedPtr<Process> Process::Create(std::string&& name, u64 program_id) { SharedPtr<Process> process(new Process); process->name = std::move(name); process->flags.raw = 0; process->flags.memory_region.Assign(MemoryRegion::APPLICATION); process->status = ProcessStatus::Created; + process->program_id = program_id; process_list.push_back(process); return process; |
