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

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

pgsql-hackers by date

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

pgsql-patches by date

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

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