software/libbase: memcpy: same with 2 alignment

This commit is contained in:
Sebastien Bourdeauducq 2012-05-27 16:06:23 +02:00
parent c4a28a404b
commit 333179e1c5
1 changed files with 15 additions and 0 deletions

View File

@ -280,6 +280,21 @@ void *memcpy(void *to, const void *from, size_t n)
from = sfrom;
n -= 2;
}
if((long)from & 2) {
short *sto = to;
const short *sfrom = from;
temp = n >> 1;
for (; temp; temp--)
*sto++ = *sfrom++;
to = sto;
from = sfrom;
if(n & 1) {
char *cto = to;
const char *cfrom = from;
*cto = *cfrom;
}
return xto;
}
temp = n >> 2;
if(temp) {
long *lto = to;