Re: [PATCH] backend: compare word-at-a-time in bcTruelen - Mailing list pgsql-hackers

From Jeremy Kerr
Subject Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Date
Msg-id 200906160951.17386.jk@ozlabs.org
Whole thread Raw
In response to Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert,

> This looks very non-portable to me.

Unsurprisingly, I'm new to postgres hacking and the large number of 
supported platforms :)

I was considering something like:
unsigned int spaces;const unsigned int wordsize = sizeof(unsigned int);
memset(&spaces, ' ', wordsize);

In most cases, the compiler should be able to optimise the memset out, 
but it may introduce overhead where this is not possible.

However, are there any supported platforms where sizeof(unsigned int) != 
4 ?

Cheers,


Jeremy


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Next
From: Stephen Frost
Date:
Subject: Re: [PATCH] backend: compare word-at-a-time in bcTruelen