Re: inline newNode()

Поиск
Список
Период
Сортировка
Искать
От
Bruce Momjian
Тема
Re: inline newNode()
Дата
Msg-id
200210090435.g994Z6B07015@candle.pha.pa.us
Ответ на
Список
Дерево обсуждения
inline newNode() Neil Conway <neilc@samurai.com>
Re: inline newNode() Tom Lane <tgl@sss.pgh.pa.us>
Re: inline newNode() Neil Conway <neilc@samurai.com>
Re: inline newNode() Tom Lane <tgl@sss.pgh.pa.us>
Re: inline newNode() Neil Conway <neilc@samurai.com>
Re: inline newNode() Tom Lane <tgl@sss.pgh.pa.us>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Tom Lane <tgl@sss.pgh.pa.us>
Re: inline newNode() Peter Eisentraut <peter_e@gmx.net>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Tom Lane <tgl@sss.pgh.pa.us>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Tom Lane <tgl@sss.pgh.pa.us>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Tom Lane <tgl@sss.pgh.pa.us>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Neil Conway <neilc@samurai.com>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Karel Zak <zakkr@zf.jcu.cz>
Re: inline newNode() Peter Eisentraut <peter_e@gmx.net>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Peter Eisentraut <peter_e@gmx.net>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Peter Eisentraut <peter_e@gmx.net>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Tom Lane <tgl@sss.pgh.pa.us>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Neil Conway <neilc@samurai.com>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Gavin Sherry <swm@linuxworld.com.au>
Re: inline newNode() Neil Conway <neilc@samurai.com>
Re: inline newNode() Peter Eisentraut <peter_e@gmx.net>
Re: inline newNode() Bruce Momjian <pgman@candle.pha.pa.us>
Re: inline newNode() Neil Conway <neilc@samurai.com>
Re: inline newNode() Peter Eisentraut <peter_e@gmx.net>
Tom Lane wrote:
> Bruce Momjian  writes:
> > Right, palloc shouldn't.  I was thinking of having another version of
> > palloc that _does_ clear out memory, and calling that from a newNode()
> > macro.  We already know palloc is going to call MemoryContextAlloc, so
> > we could have a pallocC() that calls a new MemoryContextAllocC() that
> > would call the underlying memory allocation function, then do the loop
> > like MemSet to clear it.
> 
> But if the MemSet is inside the called function then it cannot reduce
> the if-tests to a compile-time decision to invoke the word-zeroing loop.
> We want the MemSet to be expanded at the newNode call site, where the
> size of the allocated memory is a compile-time constant.

I can easily do the tests in the MemSet macro, but I can't do a loop in
a macro that has to return a value;  I need while().  Though a loop in a
new fuction will not be as fast as a MemSet macro, I think it will be
better than what we have now with newNode only because newNode will be a
macro and not a function anymore, i.e. the MemSet will happen in the
function called by pallocC and not in newNode anymore, and there will be
zero code bloat.  I wish I saw another way.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
В списке pgsql-patches по дате отправления
От: Tom Lane
Дата:
Сообщение: Re: inline newNode()
От: Bruce Momjian
Дата:
FAQ