Re: inline newNode()

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: inline newNode()
Дата
Msg-id 87lm57o5ij.fsf@mailbox.samurai.com
обсуждение исходный текст
Ответ на Re: inline newNode()  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: inline newNode()  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> OK, here's a patch for testing.  It needs cleanup because the final
> version would remove the nodes/nodes.c file.  The net effect of the
> patch is to make newNode a macro with little code bloat.

Ok, I think this is the better version. The performance seems to be
about the same as my original patch, and the code bloat is a lot less:
12857787 with the patch versus 12845168 without it. The
implemementation (with a global variable) is pretty ugly, but I don't
really see a way around that...

One minor quibble with the patch though: MemoryContextAllocC() and
pallocC() aren't very good function names, IMHO. Perhaps
MemoryContextAllocZero() and palloc0() would be better?

This isn't specific to your patch, but it occurs to me that we could
save a few bits of code bloat if we removed the '_len' variable
declaration from the MemSet() macro -- it isn't needed, AFAICT. That
would mean we we'd evaluate the 'len' argument multiple times, so I'm
not sure if that's a win overall...

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pltcl and plpython memory leak revisited (fwd)
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: inline newNode()