From 52b12478c63a911aa4c1cc17a630bd43708e1f9e Mon Sep 17 00:00:00 2001 From: leitner Date: Wed, 14 Aug 2002 13:54:36 +0000 Subject: [PATCH] only use faster byte_copy on i386 to avoid bus error --- CHANGES | 3 +++ byte/byte_copy.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index fa8b753..1db5dc1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +0.14: + only use faster byte_copy on i386 + 0.13: fixed several bugs in test/uudecode.c add uninstall target diff --git a/byte/byte_copy.c b/byte/byte_copy.c index f9ce794..4166e46 100644 --- a/byte/byte_copy.c +++ b/byte/byte_copy.c @@ -6,6 +6,7 @@ void byte_copy(void* out, unsigned int len, const void* in) { register char* s=out; register const char* t=in; register const char* u=t+len; +#ifdef __i386__ if (len>127) { if (sizeof(unsigned long)>4) { /* a good compiler should optimize this check away */ for (;(unsigned long)t&7;) { @@ -21,6 +22,7 @@ void byte_copy(void* out, unsigned int len, const void* in) { s+=sizeof(long); t+=sizeof(long); } } +#endif for (;;) { if (t==u) break; *s=*t; ++s; ++t; if (t==u) break; *s=*t; ++s; ++t;