mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Avoid calling GetPointer() multiple times in a row
This commit is contained in:
parent
2e675c7b0b
commit
81197f18a0
1 changed files with 3 additions and 2 deletions
|
@ -215,10 +215,11 @@ struct MsgPipe : public KernelObject
|
|||
// Receive as much as possible, even if it's not enough to wake up.
|
||||
u32 bytesToSend = std::min(thread->freeSize, GetUsedSize());
|
||||
|
||||
thread->WriteBuffer(Memory::GetPointer(buffer), bytesToSend);
|
||||
u8* ptr = Memory::GetPointer(buffer);
|
||||
thread->WriteBuffer(ptr, bytesToSend);
|
||||
// Put the unused data at the start of the buffer.
|
||||
nmp.freeSize += bytesToSend;
|
||||
memmove(Memory::GetPointer(buffer), Memory::GetPointer(buffer) + bytesToSend, GetUsedSize());
|
||||
memmove(ptr, ptr + bytesToSend, GetUsedSize());
|
||||
freedSpace = true;
|
||||
|
||||
if (thread->waitMode == SCE_KERNEL_MPW_ASAP || thread->freeSize == 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue