[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [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) ?

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.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.