From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony PERARD Subject: Re: [PATCH 2/2] libxl: Have flexarray using the GC Date: Mon, 1 Oct 2012 15:15:07 +0100 Message-ID: <5069A56B.4000605@citrix.com> References: <1348666294-18182-1-git-send-email-anthony.perard@citrix.com> <1348666294-18182-3-git-send-email-anthony.perard@citrix.com> <20581.56805.294140.556698@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20581.56805.294140.556698@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Ian Campbell , Xen Devel List-Id: xen-devel@lists.xenproject.org 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