Tom Lane 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?
> 1. Teach pg_malloc not to complain if result == NULL and size == 0.
What a
Peter Geoghegan writes:
> On 1 October 2012 15:00, Tom Lane wrote:
>> 1. Teach pg_malloc not to complain if result == NULL and size == 0.
> +1 to that proposal.
>> 2. Before the malloc call, have it replace size == 0 with size = 1.
> I don't like that proposal on purely aesthetic grounds.
As
Dimitri Fontaine writes:
> Tom Lane 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, w
On 1 October 2012 15:00, Tom Lane wrote:
> 1. Teach pg_malloc not to complain if result == NULL and size == 0.
+1 to that proposal.
> 2. Before the malloc call, have it replace size == 0 with size = 1.
I don't like that proposal on purely aesthetic grounds.
--
Peter Geoghegan http://www
Per
http://archives.postgresql.org/pgsql-general/2012-10/msg00013.php
we have got a problem with the pg_malloc() interface functions that
were recently added to pg_dump and a lot of other frontend code.
Namely, that on platforms where malloc(0) returns NULL instead of
a pointer to a zero-size block