diff options
author | Nebuleon Fumika | 2013-02-01 00:33:30 -0500 |
---|---|---|
committer | Nebuleon Fumika | 2013-02-01 00:33:30 -0500 |
commit | f385752705de73b04cbbda735a71f14c19e241a6 (patch) | |
tree | 59aca906a8c3fcbaae402d503e7c6b34643e0199 /source/clip.cpp | |
parent | f0fab191e48f165c551980d724bba2f26a764795 (diff) | |
download | snesemu-f385752705de73b04cbbda735a71f14c19e241a6.tar.gz snesemu-f385752705de73b04cbbda735a71f14c19e241a6.tar.bz2 snesemu-f385752705de73b04cbbda735a71f14c19e241a6.zip |
memcpy vs memmove: memmove correctly handles overlapping source and destination memory buffers, but is slower than memcpy in many implementations. When memory buffers don't overlap, memcpy may be more efficient.
The DS2 SDK is such an implementation, so change many memmoves into memcpys.
Diffstat (limited to 'source/clip.cpp')
-rw-r--r-- | source/clip.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/clip.cpp b/source/clip.cpp index 57204ac..7147abf 100644 --- a/source/clip.cpp +++ b/source/clip.cpp @@ -291,7 +291,8 @@ void ComputeClipWindows () if (BAND_EMPTY(Win1[0])) { B = Window2Enabled; - memmove (Bands, Win2, + // memmove converted: Different stack allocations [Neb] + memcpy (Bands, Win2, sizeof(Win2[0]) * Window2Enabled); } else @@ -355,7 +356,8 @@ void ComputeClipWindows () // use window 1 as the clipping (which // could also be empty). B = Window1Enabled; - memmove (Bands, Win1, + // memmove converted: Different stack allocations [Neb] + memcpy (Bands, Win1, sizeof(Win1[0]) * Window1Enabled); } else @@ -468,14 +470,16 @@ void ComputeClipWindows () if (Window1Enabled == 1 && BAND_EMPTY(Win1[0])) { B = Window2Enabled; - memmove (Bands, Win2, + // memmove converted: Different stack allocations [Neb] + memcpy (Bands, Win2, sizeof(Win2[0]) * Window2Enabled); } else if (Window2Enabled == 1 && BAND_EMPTY(Win2[0])) { B = Window1Enabled; - memmove (Bands, Win1, + // memmove converted: Different stack allocations [Neb] + memcpy (Bands, Win1, sizeof(Win1[0]) * Window1Enabled); } else |