> -----Original Message-----
> From: Ian Jackson <ian.jack...@citrix.com>
> Sent: 28 May 2020 15:57
> To: Paul Durrant <p...@xen.org>
> Cc: xen-devel@lists.xenproject.org; Paul Durrant <pdurr...@amazon.com>; Wei 
> Liu <w...@xen.org>; Anthony
> Perard <anthony.per...@citrix.com>
> Subject: Re: [PATCH] libxl: stop libxl_domain_info() consuming massive 
> amounts of stack
> 
> Paul Durrant writes ("[PATCH] libxl: stop libxl_domain_info() consuming 
> massive amounts of stack"):
> > From: Paul Durrant <pdurr...@amazon.com>
> >
> > Currently an array of 1024 xc_domaininfo_t is declared on stack. That alone
> > consumes ~112k.
> 
> Wow.
> 
> > Since libxl_domain_info() creates a new gc this patch simply
> > uses it to allocate the array instead.
> 
> Thanks.
> 
> > +    info = libxl__calloc(gc, 1024, sizeof(*info));
> 
> Wy not GCNEW_ARRAY ?

'Cos I didn't know about that one :-)

> 
> That avoids a possible bug with wrong number of * to sizeof (although
> in this case you seem to have it right...)
> 

Cool. I'll send a v2 in mo'.

  Paul

> Thanks,
> Ian.


Reply via email to