Re: pg_malloc() versus malloc(0) - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: pg_malloc() versus malloc(0)
Date
Msg-id CAEYLb_X31-W7c7jj-ChLgu7gu7m4K=oDhFizcaQYxEu-Fwj8DA@mail.gmail.com
Whole thread Raw
In response to pg_malloc() versus malloc(0)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_malloc() versus malloc(0)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 1 October 2012 15:00, Tom Lane <tgl@sss.pgh.pa.us> 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.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Extending range of to_tsvector et al
Next
From: Bruce Momjian
Date:
Subject: Re: WIP checksums patch