From: Ian Campbell Subject: Re: [PATCH 22/28] libxl: ocaml: event management Date: Wed, 24 Apr 2013 10:02:23 +0100 Message-ID: <1366794143.20256.227.camel@zakaz.uk.xensource.com> References: <1364222729-6982-1-git-send-email-rob.hoes@citrix.com> <1364222729-6982-23-git-send-email-rob.hoes@citrix.com> <1365684085.8036.99.camel@zakaz.uk.xensource.com> <7EA643C653F17F4C80DE959E978F10ED010F729E0194@LONPMAILBOX01.citrite.net> <1366732694.20256.192.camel@zakaz.uk.xensource.com> <7EA643C653F17F4C80DE959E978F10ED010F729E0196@LONPMAILBOX01.citrite.net> <1366735194.20256.196.camel@zakaz.uk.xensource.com> <20854.48102.547875.577021@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20854.48102.547875.577021@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: Dave Scott , Rob Hoes , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Tue, 2013-04-23 at 17:50 +0100, Ian Jackson wrote: > Ian Campbell writes ("Re: [PATCH 22/28] libxl: ocaml: event management"): > > On Tue, 2013-04-23 at 17:30 +0100, Rob Hoes wrote: > > > You can keep the value alive in the "main" function or toplevel. > > > > I meant can the C bindings not take a reference to record their taking > > of the value and stashing it somewhere? > > This is probably not the best way to deal with this. It will result > in the whole libxl context never being disposed of even when it's no > longer needed. I was referring to taking a reference on the ocaml value used as the user pointer, not to taking a reference to the libxl context. Ian.