Re: MemSet inline for newNode - Mailing list pgsql-patches

From Tom Lane
Subject Re: MemSet inline for newNode
Date
Msg-id 2301.1037031824@sss.pgh.pa.us
Whole thread Raw
In response to Re: MemSet inline for newNode  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: MemSet inline for newNode
List 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 by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: MemSet inline for newNode
Next
From: Bruce Momjian
Date:
Subject: Re: MemSet inline for newNode