Re: MemSet inline for newNode

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: MemSet inline for newNode
Date: 2002-11-11 16:23:44
Message-ID: 2301.1037031824@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-11-11 16:40:02 Re: MemSet inline for newNode
Previous Message Bruce Momjian 2002-11-11 16:06:40 Re: MemSet inline for newNode

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-11-11 16:40:02 Re: MemSet inline for newNode
Previous Message Bruce Momjian 2002-11-11 16:06:40 Re: MemSet inline for newNode