From: Ian Jackson Subject: Re: [PATCH] libxl: document the memory ownership of some functions Date: Fri, 15 Jun 2012 15:11:14 +0100 Message-ID: <20443.17026.774916.705627@mariner.uk.xensource.com> References: <6337a90a11ed2ef48442.1339768347@Solace> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <6337a90a11ed2ef48442.1339768347@Solace> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org 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 But, just a suggestion: > Signed-off-by: Dario Faggioli > > 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.