Re: mcxt.c
От | Gaetano Mendola |
---|---|
Тема | Re: mcxt.c |
Дата | |
Msg-id | 001d01c3760d$c5971090$1f720b3e@mm.eutelsat.org обсуждение исходный текст |
Ответ на | mcxt.c ("Mendola Gaetano" <mendola@bigfoot.com>) |
Список | pgsql-patches |
"Tom Lane" <tgl@sss.pgh.pa.us> wrote: > "Mendola Gaetano" <mendola@bigfoot.com> writes: > > A test for null string is missing here: > > > MemoryContextStrdup(MemoryContext context, const char *string) > > { > > char *nstr; > > - > > - if ( !string ) > > - { > > - elog(ERROR, "MemoryContextStrdup called with a NULL pointer"); > > - return NULL; > > - } > > This seems inappropriate to me. Are you going to suggest that every > routine that takes a pointer parameter needs to explicitly test for > null? We could bloat the code a great deal that way, and slow it down, > without gaining anything at all in debuggability (IMHO anyway). 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 think that is reasonable. Regards Gaetano Mendola
В списке pgsql-patches по дате отправления: