mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-22 08:05:46 +00:00
kernel/shared_memory: Make Map() and Unmap() take the target process by reference rather than as a pointer
Both member functions assume the passed in target process will not be null. Instead of making this assumption implicit, we can change the functions to be references and enforce this at the type-system level.
This commit is contained in:
parent
a356495312
commit
0067bc137f
3 changed files with 12 additions and 12 deletions
|
@ -796,7 +796,7 @@ static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 s
|
|||
return ERR_INVALID_MEMORY_RANGE;
|
||||
}
|
||||
|
||||
return shared_memory->Map(current_process, addr, permissions_type, MemoryPermission::DontCare);
|
||||
return shared_memory->Map(*current_process, addr, permissions_type, MemoryPermission::DontCare);
|
||||
}
|
||||
|
||||
static ResultCode UnmapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size) {
|
||||
|
@ -826,7 +826,7 @@ static ResultCode UnmapSharedMemory(Handle shared_memory_handle, VAddr addr, u64
|
|||
return ERR_INVALID_MEMORY_RANGE;
|
||||
}
|
||||
|
||||
return shared_memory->Unmap(current_process, addr);
|
||||
return shared_memory->Unmap(*current_process, addr);
|
||||
}
|
||||
|
||||
/// Query process memory
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue