Re: MemSet inline for newNode

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: MemSet inline for newNode
Дата
Msg-id 200211111640.gABGe2U02117@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: MemSet inline for newNode  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: MemSet inline for newNode  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Tom Lane wrote:
> 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

I can't do MemSet in a macro that returns a value, as palloc requires.
MemSet has a loop, and that can't be done in a macro that returns a value.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: MemSet inline for newNode
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: minor SGML fix