[sheepdog] [PATCH] util: make xvalloc() return zeroed memory

Hitoshi Mitake mitake.hitoshi at gmail.com
Wed Jan 15 08:54:42 CET 2014


At Wed, 15 Jan 2014 15:16:00 +0800,
Liu Yuan wrote:
> 
> This actuall fixes a bug that 045 fails with -ec specified. Instead of add a
> memset() to init_erasure_buffer() to fix the bug, I prefer to make xvalloc()
> a zeroed memory version, because:
> 
> - present CPU and glibc is very good at zero out a memory region.
> - zeroed version will avoid future misuage of xvalloc() that expect it to return
>   zeroed memory.
> 
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
>  lib/util.c | 2 ++
>  1 file changed, 2 insertions(+)

Looks good to me.
Reviewed-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>

Thanks,
Hitoshi



More information about the sheepdog mailing list