[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] libxl: use libxl__zcalloc instead calloc



On Thu, 2012-05-17 at 06:01 +0100, Zhang, Yang Z wrote:
> since libxl__zalloc never fails, it's better to use it.


> Signed-off-by: Yang Zhang <yang.z.zhang@xxxxxxxxx>

It'd have been clearer to use libxl__calloc instead. Nevertheless:

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> 
> diff -r 612a24c8c4f9 -r c8a01e966ec8 tools/libxl/libxl_utils.c
> --- a/tools/libxl/libxl_utils.c Tue May 15 17:01:54 2012 +0100
> +++ b/tools/libxl/libxl_utils.c Thu May 17 12:59:49 2012 +0800
> @@ -498,9 +498,7 @@ int libxl_cpumap_alloc(libxl_ctx *ctx, l
>          return ERROR_FAIL;
> 
>      sz = (max_cpus + 7) / 8;
> -    cpumap->map = calloc(sz, sizeof(*cpumap->map));
> -    if (!cpumap->map)
> -        return ERROR_NOMEM;
> +    cpumap->map = libxl__zalloc(NULL, sz * sizeof(*cpumap->map));
>      cpumap->size = sz;
>      return 0;
>  }
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.