From 82c15f2d93f63787b0e52360ba6c6eb4237497c7 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 25 Dec 2007 21:37:48 +0000 Subject: [PATCH] --- ase/cmn/mem.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ase/cmn/mem.c b/ase/cmn/mem.c index 45d05cb9..97efd62f 100644 --- a/ase/cmn/mem.c +++ b/ase/cmn/mem.c @@ -10,6 +10,10 @@ #define IS_UNALIGNED(ptr) (((ase_size_t)ptr)&(sizeof(ase_size_t)-1)) #define IS_ALIGNED(ptr) (!IS_UNALIGNED(ptr)) +#define IS_EITHER_UNALIGNED(ptr1,ptr2) \ + (((ase_size_t)ptr1|(ase_size_t)ptr2)&(sizeof(ase_size_t)-1)) +#define IS_BOTH_ALIGNED(ptr1,ptr2) (!IS_EITHER_UNALIGNED(ptr1,ptr2)) + void* ase_memcpy (void* dst, const void* src, ase_size_t n) { /* @@ -31,7 +35,8 @@ void* ase_memcpy (void* dst, const void* src, ase_size_t n) ASE_ASSERT (sizeof(ase_size_t) == sizeof(void*)); - if (IS_ALIGNED(dst) && IS_ALIGNED(src)) + /*if (IS_ALIGNED(dst) && IS_ALIGNED(src))*/ + if (IS_BOTH_ALIGNED(dst,src)) { /* if both src and dst are aligned, * blockcopy sizeof(void*) bytes. */