[PATCH 2 of 3] C implementation of revlog index parsing

Matt Mackall mpm at selenic.com
Sat Oct 18 10:45:42 CDT 2008


On Sat, 2008-10-18 at 16:47 +0200, Benoit Boissinot wrote:
> On Fri, Oct 17, 2008 at 1:06 AM, Bernhard Leiner
> <mailinglists.bleiner at gmail.com> wrote:
> > # HG changeset patch
> > # User Bernhard Leiner <bleiner at gmail.com>
> > # Date 1224198218 -7200
> > # Node ID c717c768337dae079aa94b1850f812fd3354bd4c
> > # Parent  fd5170c86abb716769ba5e84c19b87fc8ee83f68
> > C implementation of revlog index parsing
> >
> > +static inline uint64_t ntohll(uint64_t x)
> > +{
> > +       return (((uint64_t)ntohl((uint32_t)x)) << 32) |
> > +               (uint64_t)ntohl((uint32_t)(x >> 32));
> > +}
> 
> I've heard a ppc processor being very unhappy with this ;)

We shouldn't even need it. We should instead read 2 32-bit vales, use
ntohl on each and build 1 16-bit value (flags) and 1 48-bit value
(offset).

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list