mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-24 06:43:45 +01:00
Merge pull request #7216 from chinhodado/patch-1
Avoid calling GetPointer() multiple times in a row
This commit is contained in:
commit
102aa8e387
1 file changed
+3
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user