Skip to content

Commit e8d330b

Browse files
committed
update naive memcpy im so stupid orhh
1 parent 947635c commit e8d330b

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

src/memory/memcpy/memcpy.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
//
77
//////////////////////////////////////
88

9-
#if defined(__linux__)
10-
119
STATIC void *_eth_memcpy_naive (void *restrict dst, const void *restrict src, size_t size)
1210
{
1311
if (!dst || !src || !size)
@@ -20,25 +18,14 @@ STATIC void *_eth_memcpy_naive (void *restrict dst, const void *restrict src, si
2018
return (dst);
2119
}
2220

21+
#if defined(__linux__)
22+
2323
void *(*_eth_memcpy_ifunc (void)) (void *restrict, const void *restrict, size_t)
2424
{
2525
return (_eth_memcpy_naive);
2626
}
2727

2828
void *eth_memcpy (void *restrict dst, const void *restrict src, size_t size) __attribute__((ifunc ("_eth_memcpy_ifunc")));
2929

30-
#else
31-
32-
void * _eth_memcpy_naive (void *restrict dst, const void *restrict src, size_t size)
33-
{
34-
if (!dst || !src || !size)
35-
return (dst);
36-
37-
u8_t *psrc = (u8_t *) src;
38-
u8_t *pdst = (u8_t *) dst;
39-
40-
while (size--) *pdst++ = *psrc++;
41-
return (dst);
42-
}
4330

4431
#endif

0 commit comments

Comments
 (0)