Re: mcxt.c

From: "Serguei Mokhov" <mokhov(at)cs(dot)concordia(dot)ca>
To: <pgsql-hackers(at)postgresql(dot)org>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <mendola(at)bigfoot(dot)com>
Subject: Re: mcxt.c
Date: 2003-09-08 17:14:09
Message-ID: 007101c3762c$9f5e45a0$0301a8c0@gunnymede.lan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Date: Mon, 08 Sep 2003 09:57:30 -0400
> From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>
> "Gaetano Mendola" <mendola(at)bigfoot(dot)com> writes:
> > "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)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

Browse pgsql-hackers by date

  From Date Subject
Next Message Jenny - 2003-09-08 17:17:46 Re: row level lock and table level locks
Previous Message Larry Rosenman 2003-09-08 17:07:27 Re: FreeBSD/i386 thread test