Re: Why pfree(NULL) breaks execution?

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Why pfree(NULL) breaks execution?
Дата
Msg-id AANLkTi=hpBiVdyaFayuvd250ibpZoT8eih58UG7t9cu=@mail.gmail.com
обсуждение исходный текст
Ответ на Why pfree(NULL) breaks execution?  (Marios Vodas <mvodas@gmail.com>)
Ответы Re: Why pfree(NULL) breaks execution?  (Peter Geoghegan <peter.geoghegan86@gmail.com>)
Список pgsql-hackers
On Fri, Mar 4, 2011 at 8:08 AM, Marios Vodas <mvodas@gmail.com> wrote:
> C doesn't break on free(NULL) so why is pfree developed to break on NULL?
> Is there any way in PostgreSQL to overcome this so that it won't break,
> apart from checking if the pointer NULL?

I think that free(NULL) works on some platforms but not all.  I don't
see what advantage we'd get out of making pfree(NULL) silently work,
and there's a clear disadvantage: it would remove a useful sanity
check.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: pg_basebackup and wal streaming
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Why pfree(NULL) breaks execution?