From: Ian Campbell Subject: Re: [PATCH 2/3] libxl: ocaml: use int64 for timeval fields in the timeout_register callback Date: Thu, 12 Dec 2013 17:20:46 +0000 Message-ID: <1386868846.20076.17.camel@kazak.uk.xensource.com> References: <1386866211-12639-1-git-send-email-rob.hoes@citrix.com> <1386866211-12639-3-git-send-email-rob.hoes@citrix.com> <21161.59304.396688.333495@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21161.59304.396688.333495@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@eu.citrix.com, Rob Hoes , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2013-12-12 at 16:43 +0000, Ian Jackson wrote: > Rob Hoes writes ("[PATCH 2/3] libxl: ocaml: use int64 for timeval fields in the timeout_register callback"): > > The original code works fine on 64-bit, but on 32-bit, the OCaml int > > (which is 1 bit smaller than the C int) is likely to overflow. > > The timeouts are in milliseconds. 2^30 ms is 1.07megaseconds, or 12.4 > days. > > If it would help I would be happy to have libxl promise never to use > such absurdly long timeouts. I see the conversation has moved on but I thought it would be worth pointing out that for IDL defined datatypes we have declared that an integer is a signed 24 bit type, exactly to help with languages which steal bit or two. See the end of tools/libxl/idl.txt The IDL has separate explicitly sized 32- and 64-bit types too. Ian.