Re: mcxt.c

Поиск
Список
Период
Сортировка
От Serguei Mokhov
Тема Re: mcxt.c
Дата
Msg-id 007101c3762c$9f5e45a0$0301a8c0@gunnymede.lan
обсуждение исходный текст
Список pgsql-hackers
> Date: Mon, 08 Sep 2003 09:57:30 -0400
> From: Tom Lane <tgl@sss.pgh.pa.us>
> 
> "Gaetano Mendola" <mendola@bigfoot.com> writes:
> > "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
> >> This seems inappropriate to me.  Are you going to suggest that every
> >> routine that takes a pointer parameter needs to explicitly test for
> >> null?
> 
> > Of course I'm not suggesting this, what I'm suggesting is put an
> > assert( ) if the test can slow down the performances and an "if ( ) "
> > in places that are not going to touch the performances.
> 
> I see no value at all in an assert.  The code will dump core just fine
> with or without an assert ...

What if define that if() as a macro? This would avoid the code bloat and allow
the paranoid users have the check if they want to. In analogy to "--cassert"
and "--debug", one could add a "--null-paranoid" option :) that would make
that macro defined. That would be no slowdown for non-paranoids and a friendly
error reporting for paranoids. Though I'm not sure if it is worthwhile of 
maintenance effort and falling back onto core dump would always "work".

-s



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

Предыдущее
От: Larry Rosenman
Дата:
Сообщение: Re: FreeBSD/i386 thread test
Следующее
От: "Jenny -"
Дата:
Сообщение: Re: row level lock and table level locks