Re: pg_malloc() versus malloc(0)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_malloc() versus malloc(0)
Дата
Msg-id 24153.1349102738@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg_malloc() versus malloc(0)  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Список pgsql-hackers
Dimitri Fontaine <dimitri@2ndQuadrant.fr> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> Namely, that on platforms where malloc(0) returns NULL instead of
>> a pointer to a zero-size block, pg_malloc thinks it's a failure
>> and aborts the program.

> What's the use case for malloc(0) anyway?

See getAggregates() for an example.  Yeah, we could add a special-case
code path for no aggregates, but it would be annoying and error-prone.
        regards, tom lane



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: WIP checksums patch
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: CTE optimization fence on the todo list?