Skip site navigation (1) Skip section navigation (2)

Re: pg_malloc() versus malloc(0)

From: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_malloc() versus malloc(0)
Date: 2012-10-01 14:37:11
Message-ID: CAEYLb_X31-W7c7jj-ChLgu7gu7m4K=oDhFizcaQYxEu-Fwj8DA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On 1 October 2012 15:00, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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


In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2012-10-01 14:43:00
Subject: Re: WIP checksums patch
Previous:From: Tom LaneDate: 2012-10-01 14:36:52
Subject: Re: Extending range of to_tsvector et al

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group