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

Re: [Xen-devel] [PATCH] libxl: document the memory ownership of some functions



Dario Faggioli writes ("[PATCH] libxl: document the memory ownership of some 
functions"):
> Specifying they allocate dynamic memory that needs to be explicitly freed.

Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

But, just a suggestion:

> Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
> 
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h

Perhaps it would be worth writing this comment once near the top, eg:

 /* These functions each return (on success) an array of elements,
  * and the length via the int* out parameter.  These arrays and
  * their contents come from malloc, and must be freed with the
  * corresponding libxl_THING_list_free function.
  */

And perhaps change  int *nb_domain  etc. to  int *nb_domain_out.

Ian.

_______________________________________________
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®.