All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Jackson <Ian.Jackson@citrix.com>
Cc: Dave Scott <Dave.Scott@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 2/3] libxl: ocaml: use int64 for timeval fields in the timeout_register callback
Date: Thu, 12 Dec 2013 17:25:47 +0000	[thread overview]
Message-ID: <360717C0B01E6345BCBE64B758E22C2D1AC4E5@AMSPEX01CL03.citrite.net> (raw)
In-Reply-To: <21161.61138.126582.556698@mariner.uk.xensource.com>

Ian Jackson wrote:
> Sent: 12 December 2013 5:14 PM
> To: Rob Hoes
> Cc: xen-devel@lists.xen.org; Ian Campbell; Dave Scott
> Subject: RE: [PATCH 2/3] libxl: ocaml: use int64 for timeval fields in the
> timeout_register callback
> 
> Rob Hoes writes ("RE: [PATCH 2/3] libxl: ocaml: use int64 for timeval
> fields in the timeout_register callback"):
> > Ian Jackson wrote:
> > > (The tv_nsec field is guaranteed to be < 1E9 so fits in 30 bits...)
> >
> > The OCaml Unix.gettimeofday function returns a number of type "float",
> which in OCaml is a 64-bit number. This may be an alternative.
> 
> You mean it has a 64-bit mantissa, or it's 64 bits big (an IEEE
> double) ?

64 bits big, according to the IEEE 754 standard (http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html),

> Also that's a very strange way of representing a timeval (which is mixed
> radix, since the two halves have relative weight 10^9 rather than 2^n).
> 
> > I just thought it would be best to stay as close as possible to the C
> > implementation in the bindings, and return the two separate numbers
> > that we are given.
> 
> Right.  I think on the basis of what you've said, that makes sense,
> although I'm not sure whether nsec should be 32 (30+sign) or 64.

I guess we can probably get away with 32 bits for that one, based on what we know the of the range of possible values. I'd just like to avoid any possible trouble, and didn't think those extra bits would cause too much harm.

Rob

  reply	other threads:[~2013-12-12 17:25 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-12 16:36 libxl: ocaml: fix tests makefile and osevent callbacks Rob Hoes
2013-12-12 16:36 ` [PATCH 1/3] ocaml: do not install test binaries Rob Hoes
2013-12-12 16:43   ` Ian Jackson
2013-12-12 17:22     ` Ian Campbell
2013-12-12 16:36 ` [PATCH 2/3] libxl: ocaml: use int64 for timeval fields in the timeout_register callback Rob Hoes
2013-12-12 16:43   ` Ian Jackson
2013-12-12 16:48     ` Rob Hoes
2013-12-12 16:51       ` Ian Jackson
2013-12-12 17:03         ` Rob Hoes
2013-12-12 17:13           ` Ian Jackson
2013-12-12 17:25             ` Rob Hoes [this message]
2013-12-12 17:43               ` Ian Jackson
2013-12-12 18:32                 ` Ian Jackson
2013-12-16 16:38                   ` Ian Campbell
2013-12-16 17:06                     ` Ian Jackson
2013-12-20 15:28                       ` David Scott
2013-12-12 17:20     ` Ian Campbell
2014-01-07 17:41   ` Ian Jackson
2014-01-08 14:35     ` Ian Campbell
2013-12-12 16:36 ` [PATCH 3/3] libxl: ocaml: use 'for_app_registration' in osevent callbacks Rob Hoes
2013-12-12 17:40   ` Ian Campbell
2013-12-12 17:53     ` Ian Jackson
2013-12-12 17:54     ` Rob Hoes
2013-12-12 19:18       ` Ian Campbell
2013-12-12 21:27         ` Rob Hoes
2013-12-13  8:07           ` Ian Campbell
2013-12-12 21:40     ` Rob Hoes
2013-12-13 11:44       ` Ian Jackson
2013-12-13 17:20   ` [PATCH v2 " Rob Hoes
2013-12-13 17:24     ` Ian Jackson
2013-12-13 18:04       ` Rob Hoes
2013-12-13 18:21         ` Ian Jackson
2013-12-13 18:48           ` Rob Hoes
2013-12-16 12:02             ` Ian Jackson
2013-12-20 15:29               ` David Scott
2013-12-16 11:35         ` Ian Campbell
2013-12-16 11:37           ` Ian Campbell
2014-01-07 15:11     ` Ian Jackson
2014-01-07 17:25       ` Rob Hoes
2014-01-07 17:39         ` Ian Jackson
2014-01-07 18:05           ` Rob Hoes
2014-01-07 18:18             ` Ian Jackson
2014-01-08 16:17     ` [PATCH v3 " Rob Hoes
2014-01-08 17:06       ` Ian Jackson
2014-01-09 14:25         ` Rob Hoes
2014-01-09 17:36       ` [PATCH v4 " Rob Hoes
2014-01-09 18:17         ` Ian Jackson
2014-01-10 13:44           ` Rob Hoes
2014-01-10 13:52         ` [PATCH v5 " Rob Hoes
2014-01-10 13:55           ` Ian Jackson
2014-01-07 12:26 ` libxl: ocaml: fix tests makefile and " Ian Campbell
2014-01-07 14:13   ` Rob Hoes
2014-01-07 14:18     ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=360717C0B01E6345BCBE64B758E22C2D1AC4E5@AMSPEX01CL03.citrite.net \
    --to=rob.hoes@citrix.com \
    --cc=Dave.Scott@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.