Re: Re: [PATCH 3/8] Add support for a generic wal reading facility dubbed XLogReader

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: Re: [PATCH 3/8] Add support for a generic wal reading facility dubbed XLogReader
Date: 2012-10-29 20:31:33
Message-ID: 23855.1351542693@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> I think you may have converted some malloc() calls from Andres' patch
> into palloc() -- because you have some palloc() calls which are later
> checked for NULL results, which obviously doesn't make sense. At the
> same time, if we're going to use malloc() instead of palloc(), we need
> to check for NULL return value in XLogReaderAllocate() callers. This
> seems easy to fix at first glance, but what is the correct response if
> it fails during StartupXLOG()? Should we just elog(FATAL) and hope it
> never happens in practice?

Um, surely we can still let those functions use palloc? It should
just be #define'd as pg_malloc() (ie something with an error exit)
in non-backend contexts.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-10-29 20:33:25 Re: Patch für MAP_HUGETLB for mmap() shared memory
Previous Message Jim Nasby 2012-10-29 20:31:13 Re: WIP checksums patch