|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 03 of 10 [RFC]] libxc, libxl: Introduce xc_nodemap_t and libxl_nodemap
On Wed, 2012-04-11 at 17:38 +0100, George Dunlap wrote:
> > - sz = xc_get_cpumap_size(xch);
> > +/* XXX See [*] below ... */
> > +static xc_cpumap_t __xc_map_alloc(xc_interface *xch, int sz)
> > +{
> > if (sz == 0)
> > return NULL;
> > return calloc(1, sz);
> > }
> >
> > +xc_cpumap_t xc_cpumap_alloc(xc_interface *xch)
> > +{
> > + return __xc_map_alloc(xch, xc_get_cpumap_size(xch));
> > +}
> > +
> > +xc_nodemap_t xc_nodemap_alloc(xc_interface *xch)
> > +{
> > + /* XXX [*] How bad is this? Ideas? */
> > + return (xc_nodemap_t) __xc_map_alloc(xch, xc_get_nodemap_size(xch));
> > +}
> > +
> I don't think it's incredibly terrible if it would buy us something; but
> I don't really see that it does.
>
Fine. :-)
> Two functions would be a lot more
> readable, IMHO.
>
I'm not entirely sure I see what you mean with "two functions". The main
issue here is __xc_map_alloc returning an xc_cpumap_t. BTW, reading your
comment it came to my mind that something like the below (removing
__xc_map_alloc, which after all, is very small!) would be better... Was
it this what you had in mind when talking about two functions?
xc_cpumap_t xc_cpumap_alloc(xc_interface *xch)
{
if (sz == 0)
return NULL;
return calloc(1, sz);
}
xc_nodemap_t xc_nodemap_alloc(xc_interface *xch)
{
if (sz == 0)
return NULL;
return calloc(1, sz);
}
> Other than that, looks fine.
>
Thanks for looking into this so quickly! :-P
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
Attachment:
signature.asc _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |