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

Re: [Xen-devel] [PATCH 23 of 32 RFC] libxl: use libxl_*_init internally too



Ian Campbell writes ("Re: [Xen-devel] [PATCH 23 of 32 RFC] libxl: use 
libxl_*_init internally   too"):
> On Mon, 2012-01-16 at 16:16 +0000, Ian Jackson wrote:
> > Why might they need to allocate memory ?
> 
> e.g. vif->model = strdup("rtl8139").

That should be done in setdefault, not in init.  If for no other
reason than doing it in init means the application has to free again
this string which we pointless allocated.

> > Having infallible init functions is a real boon because it makes the
> > caller's memory management much easier, because they can always safely
> > dispose.
> 
> I think my series has made more *_init functions have no possibility of
> failure but I don't think it is all of them.

Are there any that are left that are fallible ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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