commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r884897 - /commons/sandbox/runtime/trunk/src/main/native/shared/array.c
Date Fri, 27 Nov 2009 15:49:34 GMT
Author: mturk
Date: Fri Nov 27 15:49:34 2009
New Revision: 884897

URL: http://svn.apache.org/viewvc?rev=884897&view=rev
Log:
Use memmove in case arrays by any chance share the same address range

Modified:
    commons/sandbox/runtime/trunk/src/main/native/shared/array.c

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/array.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/array.c?rev=884897&r1=884896&r2=884897&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/array.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/array.c Fri Nov 27 15:49:34 2009
@@ -58,8 +58,8 @@
     scp = (*_E)->GetPrimitiveArrayCritical(_E, src, NULL);
     dcp = (*_E)->GetPrimitiveArrayCritical(_E, dst, NULL);
     if (scp && dcp) {
-        memcpy(dcp + (size_t)dstOff,
-               scp + (size_t)srcOff, (size_t)nbytes);
+        memmove(dcp + (size_t)dstOff,
+                scp + (size_t)srcOff, (size_t)nbytes);
         (*_E)->ReleasePrimitiveArrayCritical(_E, src, scp, 0);
         (*_E)->ReleasePrimitiveArrayCritical(_E, src, dcp, 0);
         return JNI_TRUE;



Mime
View raw message