kernel/process: Use accessors instead of class members for referencing segment array

Using member variables for referencing the segments array increases the
size of the class in memory for little benefit. The same behavior can be
achieved through the use of accessors that just return the relevant
segment.
This commit is contained in:
Lioncash 2018-08-03 14:33:59 -04:00 committed by fearlessTobi
parent 47025552c7
commit 37e78de206
3 changed files with 41 additions and 17 deletions

View file

@ -133,9 +133,9 @@ void Process::Run(s32 main_thread_priority, u32 stack_size) {
};
// Map CodeSet segments
MapSegment(codeset->code, VMAPermission::ReadExecute, MemoryState::Code);
MapSegment(codeset->rodata, VMAPermission::Read, MemoryState::Code);
MapSegment(codeset->data, VMAPermission::ReadWrite, MemoryState::Private);
MapSegment(codeset->CodeSegment(), VMAPermission::ReadExecute, MemoryState::Code);
MapSegment(codeset->RODataSegment(), VMAPermission::Read, MemoryState::Code);
MapSegment(codeset->DataSegment(), VMAPermission::ReadWrite, MemoryState::Private);
// Allocate and map stack
vm_manager