use bcopy4 if defined
authorclaus
Fri, 28 Oct 1994 02:19:37 +0100
changeset 166 52d5a0cba559
parent 165 63341654cfb8
child 167 f93304c133e3
use bcopy4 if defined
ByteArray.st
--- a/ByteArray.st	Fri Oct 28 02:19:22 1994 +0100
+++ b/ByteArray.st	Fri Oct 28 02:19:37 1994 +0100
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.17 1994-10-10 00:22:26 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.18 1994-10-28 01:19:37 claus Exp $
 '!
 
 !ByteArray class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.17 1994-10-10 00:22:26 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.18 1994-10-28 01:19:37 claus Exp $
 "
 !
 
@@ -1092,7 +1092,23 @@
 		    }
 		}
 #ifdef FAST_MEMCPY
-		bcopy(src, dst, count);
+# ifdef bcopy4
+		if (((src & 3) == 0)
+		 && ((dst & 3) == 0)) {
+		    /* copy aligned part */
+		    bcopy4(src, dst, count//4);
+		    /* copy rest */
+		    if (count & 3) {
+			src += (count & ~3);
+			dst += (count & ~3);
+			count = count & 3;
+			while (count--) {
+			    *dst++ = *src++;
+			}
+		    }
+		} else
+# endif /* bcopy4 */
+		    bcopy(src, dst, count);
 #else
 		while (count-- > 0) {
 		    *dst++ = *src++;