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

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Дата
Msg-id 603c8f070906160503n42df8bafo26317e93ee5b5751@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Greg Stark <gsstark@mit.edu>)
Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Stephen Frost <sfrost@snowman.net>)
Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers
On Tue, Jun 16, 2009 at 6:30 AM, Stephen Frost<sfrost@snowman.net> wrote:
> * 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".

I see that... but I don't think the test in the first loop is correct.It's based on the value of i % 4, but I'm not
convincedthat you know 
anything about the alignment at the point where i == 0.

I might be all wet here, I haven't looked at this area of the code in detail.

> 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.

Well, if it's char(n) for n <~ 126, it's going to have a 1-byte
varlena header...

...Robert


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Synch Rep: communication between backends and walsender
Следующее
От: Greg Stark
Дата:
Сообщение: Re: machine-readable explain output