Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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

pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group