Merge pull request #942 from flyingcys/master

[Kernel] fix rt_memcpy in RT_USING_TINY_SIZE enable
This commit is contained in:
Bernard Xiong 2017-11-02 11:43:26 +08:00 committed by GitHub
commit 23582c8129
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 4 deletions

View File

@ -220,11 +220,20 @@ void *rt_memcpy(void *dst, const void *src, rt_ubase_t count)
{
#ifdef RT_USING_TINY_SIZE
char *tmp = (char *)dst, *s = (char *)src;
rt_ubase_t len;
if(tmp <= s || tmp > (s + count))
{
while (count--)
*tmp ++ = *s ++;
}
else
{
for(len = count; len > 0; len --)
tmp[len -1] = s[len - 1];
}
while (count--)
*tmp++ = *s++;
return dst;
return dst;
#else
#define UNALIGNED(X, Y) \