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

Re: [Xen-devel] [PATCH 2/2] libxl: Have flexarray using the GC



On 09/28/2012 06:27 PM, Ian Jackson wrote:
> Anthony PERARD writes ("[Xen-devel] [PATCH 2/2] libxl: Have flexarray
using the GC"):
>> This patch makes the flexarray function libxl__gc aware.
> ...
>> -flexarray_t *flexarray_make(int size, int autogrow)
>> +flexarray_t *flexarray_make(libxl__gc *gc, int size, int autogrow)
> ...
>>  {
> ...
>> +    array->gc = gc;
>
> If gc is NOGC then this does the wrong thing.  Callers should be able
> to specify NOGC for a flexarray which they want to survive across
> multiple calls into libxl.

I'm not sure I see your point here.  If a something needs a NOGC'ed
flexarray, then flexarray_make(NOGC, x, x) will give this.

> For this all to work correctly, including error handling, I think
> flexarray_grow and its callers need to take a gc from the context.  It
> would be wise to assert that the either 1. both the gc passed to make
> and grow are NOGC or 2. they are the same.

All right, I'll add gc to _grow and it's caller. And will assert on both
condition.

Thanks,

-- 
Anthony PERARD

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