From 0f2f25845d0b5feb8b08ca08bf9d73f38181a16c Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Mon, 24 Nov 2014 10:00:46 +0100 Subject: [PATCH] core: use memcpy and reserve function newMem is a new memory allocated by "new". There is no way that is overlap with previous allocation. Therefore the faster memcpy can be used safely --- pcsx2/x86/BaseblockEx.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pcsx2/x86/BaseblockEx.h b/pcsx2/x86/BaseblockEx.h index 3f0fe2af64..4d20af2b29 100644 --- a/pcsx2/x86/BaseblockEx.h +++ b/pcsx2/x86/BaseblockEx.h @@ -53,7 +53,7 @@ class BaseBlockArray { pxAssert(size > 0); BASEBLOCKEX *newMem = new BASEBLOCKEX[size]; if(blocks) { - memmove(newMem, blocks, _Reserved * sizeof(BASEBLOCKEX)); + memcpy(newMem, blocks, _Reserved * sizeof(BASEBLOCKEX)); delete[] blocks; } blocks = newMem; @@ -84,8 +84,7 @@ public: BASEBLOCKEX *insert(u32 startpc, uptr fnptr) { if(_Size + 1 >= _Reserved) { - resize(_Reserved + 0x2000); - _Reserved += 0x2000; // some games requires even more! + reserve(_Reserved + 0x2000); // some games requires even more! } int imin = 0, imax = _Size, imid;