Re: MemSet inline for newNode

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: MemSet inline for newNode
Дата
Msg-id 2301.1037031824@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: MemSet inline for newNode  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: MemSet inline for newNode  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I still test the palloc pointer alignment in MemSetLoop because that is
> not a constant.

But it's known aligned when you just got it from palloc.

Why don't you simply implement what was agreed to in the original
thread, namely:

    * provide a MemSetAligned macro that is just like the standard
      one except it omits the pointer alignment test

    * provide a palloc0 macro that does MemSetAligned inside the
      macro; known safe because palloc returns a maxaligned pointer

    * use palloc0 in the newNode macro

The approach you are taking is messier *and* slower than this.

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: MemSet inline for newNode
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: MemSet inline for newNode