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

From Stephen Frost
Subject Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Date
Msg-id 20090616103050.GF20436@tamriel.snowman.net
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
List pgsql-hackers
* Robert Haas (robertmhaas@gmail.com) wrote:
> As I look at this, another problem is that it seems to me that you're
> assuming that VARDATA_ANY() will return an aligned pointer, which
> isn't necessarily the case (see src/include/postgres.h).

I believe you need to look at it more carefully.  I don't think it's
making any such assumption.  Specifically, it has three loops; an "until
we're aligned" loop, then a "while we're aligned", and a "when we've
done all the aligned we could do".

On the flip side, I am curious as to if the arguments to a stored
procedure are always aligned or not.  Never had a case to care before,
but if palloc() is always going to return an aligned chunk of memory
(per MemSetAligned in c.h) it makes me wonder.
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: machine-readable explain output
Next
From: Fujii Masao
Date:
Subject: Synch Rep: communication between backends and walsender