Re: [PATCH] backend: compare word-at-a-time in bcTruelen

From: Jeremy Kerr <jk(at)ozlabs(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "<pgsql-hackers(at)postgresql(dot)org>" <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
Subject: Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Date: 2009-06-16 01:51:16
Message-ID: 200906160951.17386.jk@ozlabs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacky Leng 2009-06-16 02:12:12 Re: Should mdxxx functions(e.g. mdread, mdwrite, mdsync etc) PANIC instead of ERROR when I/O failed?
Previous Message Robert Haas 2009-06-16 01:28:48 Re: [PATCH] backend: compare word-at-a-time in bcTruelen