From: Ian Jackson Subject: Re: [PATCH 2/2] libxl: Have flexarray using the GC Date: Fri, 28 Sep 2012 18:27:01 +0100 Message-ID: <20581.56805.294140.556698@mariner.uk.xensource.com> References: <1348666294-18182-1-git-send-email-anthony.perard@citrix.com> <1348666294-18182-3-git-send-email-anthony.perard@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1348666294-18182-3-git-send-email-anthony.perard@citrix.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: Anthony PERARD Cc: Ian Campbell , Xen Devel List-Id: xen-devel@lists.xenproject.org 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. 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. Ian.