[HACKERS] Why pfree(NULL) breaks execution?

2011-03-04 Thread Marios Vodas
C doesn't break on free(NULL) so why is pfree developed to break on NULL? Is there any way in PostgreSQL to overcome this so that it won't break, apart from checking if the pointer NULL?

Re: [HACKERS] Why pfree(NULL) breaks execution?

2011-03-04 Thread Robert Haas
On Fri, Mar 4, 2011 at 8:08 AM, Marios Vodas mvo...@gmail.com wrote: C doesn't break on free(NULL) so why is pfree developed to break on NULL? Is there any way in PostgreSQL to overcome this so that it won't break, apart from checking if the pointer NULL? I think that free(NULL) works on some

Re: [HACKERS] Why pfree(NULL) breaks execution?

2011-03-04 Thread Peter Geoghegan
On 4 March 2011 14:50, Robert Haas robertmh...@gmail.com wrote: I think that free(NULL) works on some platforms but not all.  I don't see what advantage we'd get out of making pfree(NULL) silently work, and there's a clear disadvantage: it would remove a useful sanity check. I don't feel

Re: [HACKERS] Why pfree(NULL) breaks execution?

2011-03-04 Thread Tom Lane
Peter Geoghegan peter.geoghega...@gmail.com writes: On 4 March 2011 14:50, Robert Haas robertmh...@gmail.com wrote: I think that free(NULL) works on some platforms but not all.  I don't see what advantage we'd get out of making pfree(NULL) silently work, and there's a clear disadvantage: it