From: | Abhijit Menon-Sen <ams(at)2ndQuadrant(dot)com> |
---|---|
To: | Rahila Syed <rahilasyed90(at)gmail(dot)com> |
Cc: | Rahila Syed <rahilasyed(dot)90(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
Subject: | Re: [REVIEW] Re: Compression of full-page-writes |
Date: | 2014-06-18 12:55:34 |
Message-ID: | 20140618125534.GA18575@toroid.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
At 2014-06-18 18:10:34 +0530, rahilasyed90(at)gmail(dot)com wrote:
>
> palloc() is disallowed in critical sections and we are already in CS
> while executing this code. So we use malloc().
Are these allocations actually inside a critical section? It seems to me
that the critical section starts further down, but perhaps I am missing
something.
Second, as Andres says, you shouldn't malloc() inside a critical section
either; and anyway, certainly not without checking the return value.
> I am not sure if the change will be a significant improvement from
> performance point of view except it will save few condition checks.
Moving that allocation out of the outer for loop it's currently in is
*nothing* to do with performance, but about making the code easier to
read.
-- Abhijit
From | Date | Subject | |
---|---|---|---|
Next Message | Abhijit Menon-Sen | 2014-06-18 12:58:18 | Re: [REVIEW] Re: Compression of full-page-writes |
Previous Message | Andres Freund | 2014-06-18 12:43:02 | Re: [REVIEW] Re: Compression of full-page-writes |