5 #define SS (sizeof(size_t))
6 #define ALIGN (sizeof(size_t)-1)
7 #define ONES ((size_t)-1/UCHAR_MAX)
9 typedef struct block
{ unsigned char data
[4*SS
]; } block
;
11 void *mymemcpy(void *restrict dest
, const void *restrict src
, size_t n
)
13 unsigned char *d
= dest
;
14 const unsigned char *s
= src
;
16 for (; n
>=4*SS
; n
-=4*SS
, s
+=4*SS
, d
+=4*SS
)
17 *(block
*)d
= *(block
*)s
;
18 for (; n
; n
--) *d
++ = *s
++;