[CRIU] [PATCHv2 1/5] parasite/x86: introduce&use builtin_memset

Dmitry Safonov dsafonov at virtuozzo.com
Fri Sep 16 11:40:01 PDT 2016


On 09/16/2016 09:37 PM, Dmitry Safonov wrote:
> diff --git a/criu/include/asm-generic/string.h b/criu/include/asm-generic/string.h
> index 9e649c027da1..afea6fb490aa 100644
> --- a/criu/include/asm-generic/string.h
> +++ b/criu/include/asm-generic/string.h
> @@ -46,4 +46,15 @@ static always_inline int builtin_strncmp(const char *cs, const char *ct, size_t
>  }
>  #endif
>
> +#ifndef HAS_BUILTIN_MEMSET
> +static always_inline void builtin_memset(void *s, const int c, size_t count)
> +{
> +	int *dest = (int *)s;
> +	size_t i = 0;
> +
> +	while (i < count)
> +		dest[i++] = c;
> +}
> +#endif
> +

Oh, well, I need to iterate in (char *) here, accidentally set dest as
(int *) - will resend this patch.


-- 
              Dmitry


More information about the CRIU mailing list