Re: [HACKERS] xmalloc => pg_malloc

2012-10-04 Thread Jon Nelson
On Wed, Oct 3, 2012 at 11:36 PM, Tom Lane wrote: > Peter Eisentraut writes: >> xmalloc, xstrdup, etc. are pretty common names for functions that do >> alloc-or-die (another possible naming scheme ;-) ). The naming >> pg_malloc etc. on the other hand suggests that the allocation is being >> done

Re: [HACKERS] xmalloc => pg_malloc

2012-10-03 Thread Tom Lane
Peter Eisentraut writes: > xmalloc, xstrdup, etc. are pretty common names for functions that do > alloc-or-die (another possible naming scheme ;-) ). The naming > pg_malloc etc. on the other hand suggests that the allocation is being > done in a PostgreSQL-specific way, and anyway sounds too clos

Re: [HACKERS] xmalloc => pg_malloc

2012-10-03 Thread Peter Eisentraut
On Tue, 2012-10-02 at 12:02 -0400, Tom Lane wrote: > While looking around to fix the pg_malloc(0) issue, I noticed that > various other pieces of code such as pg_basebackup have essentially > identical functions, except they're called xmalloc(). I propose to > standardize all these things on this

Re: [HACKERS] xmalloc => pg_malloc

2012-10-02 Thread Andres Freund
On Tuesday, October 02, 2012 06:30:33 PM Tom Lane wrote: > Andres Freund writes: > >> pg_calloc (randomly different API for pg_malloc0) > > > > Do we need this? > > I thought about getting rid of it, but there are some dozens of calls > scattered across several files, so I wasn't sure it was wo

Re: [HACKERS] xmalloc => pg_malloc

2012-10-02 Thread Phil Sorber
On Tue, Oct 2, 2012 at 12:30 PM, Tom Lane wrote: > Andres Freund writes: >>> pg_calloc(randomly different API for pg_malloc0) > >> Do we need this? > > I thought about getting rid of it, but there are some dozens of calls > scattered across several files, so I wasn't sure it was worth it. > A

Re: [HACKERS] xmalloc => pg_malloc

2012-10-02 Thread Tom Lane
Andres Freund writes: >> pg_calloc(randomly different API for pg_malloc0) > Do we need this? I thought about getting rid of it, but there are some dozens of calls scattered across several files, so I wasn't sure it was worth it. Anybody else have an opinion? > I wonder whether the same set

Re: [HACKERS] xmalloc => pg_malloc

2012-10-02 Thread Bruce Momjian
On Tue, Oct 2, 2012 at 12:02:13PM -0400, Tom Lane wrote: > While looking around to fix the pg_malloc(0) issue, I noticed that > various other pieces of code such as pg_basebackup have essentially > identical functions, except they're called xmalloc(). I propose to > standardize all these things o

Re: [HACKERS] xmalloc => pg_malloc

2012-10-02 Thread Andres Freund
On Tuesday, October 02, 2012 06:02:13 PM Tom Lane wrote: > While looking around to fix the pg_malloc(0) issue, I noticed that > various other pieces of code such as pg_basebackup have essentially > identical functions, except they're called xmalloc(). I propose to > standardize all these things on

[HACKERS] xmalloc => pg_malloc

2012-10-02 Thread Tom Lane
While looking around to fix the pg_malloc(0) issue, I noticed that various other pieces of code such as pg_basebackup have essentially identical functions, except they're called xmalloc(). I propose to standardize all these things on this set of names: pg_malloc pg_malloc0 (f