Re: inline newNode()

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: inline newNode()
Date: 2002-10-10 07:22:16
Message-ID: 20021010092216.B12665@zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Wed, Oct 09, 2002 at 12:12:12AM -0400, Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > OK, here is a version of newNode that is a macro.
>
> If you use memset() instead of MemSet(), I'm afraid you're going to blow
> off most of the performance gain this was supposed to achieve.
>
> > Does anyone have additional suggestions? The only thing I can suggest
> > is to make a clear-memory version of palloc because palloc always calls
> > MemoryContextAlloc() so I can put it in there. How does that sound?
>
> I do not think palloc should auto-zero memory. Hard to explain why,
> but it just feels like a bad decision. One point is that the MemSet

Agree. The memory-management routine knows nothing about real memory
usage - maybe is zeroize memory wanted in palloc caller, but maybe
not.. The palloc() caller knows it better than plalloc(). If I good
remember same discussion was long time ago in linux-kernel list and
result was non-zeroize-memory.

Karel

--
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/

C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message 韩近强 2002-10-10 12:12:50 help
Previous Message Michael Meskes 2002-10-10 07:05:26 Bison 1.50 was released

Browse pgsql-patches by date

  From Date Subject
Next Message Martijn van Oosterhout 2002-10-10 09:20:54 EXPLAIN ANALYZE bug/patch
Previous Message Neil Conway 2002-10-10 06:51:16 Re: inline newNode()