pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Add pg_noinline macro to c.h.
3+ messages / 2 participants
[nested] [flat]
* pgsql: Add pg_noinline macro to c.h.
@ 2017-10-13 21:29 Andres Freund <andres@anarazel.de>
2017-10-13 22:32 ` Re: pgsql: Add pg_noinline macro to c.h. Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: Andres Freund @ 2017-10-13 21:29 UTC (permalink / raw)
To: pgsql-committers
Add pg_noinline macro to c.h.
Forcing a function not to be inlined can be useful if it's the
slow-path of a performance critical function, or should be visible in
profiles to allow for proper cost attribution.
Author: Andres Freund
Discussion: https://postgr.es/m/20170914061207.zxotvyopetm7lrrp@alap3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a0247e7a11bb9f5fd55694b594a3906b7bd05881
Modified Files
--------------
src/include/c.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgsql: Add pg_noinline macro to c.h.
2017-10-13 21:29 pgsql: Add pg_noinline macro to c.h. Andres Freund <andres@anarazel.de>
@ 2017-10-13 22:32 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-10-13 22:43 ` Re: pgsql: Add pg_noinline macro to c.h. Andres Freund <andres@anarazel.de>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2017-10-13 22:32 UTC (permalink / raw)
To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-committers
Andres Freund <andres@anarazel.de> writes:
> Add pg_noinline macro to c.h.
I think you want this to be parenthesized so that pgindent doesn't
go nuts when you use it. At least, that was the reason why
pg_attribute_noreturn() has parens. Even if the current version
of pgindent doesn't have that problem, I would argue that consistency
demands that you spell this pg_attribute_noinline().
regards, tom lane
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgsql: Add pg_noinline macro to c.h.
2017-10-13 21:29 pgsql: Add pg_noinline macro to c.h. Andres Freund <andres@anarazel.de>
2017-10-13 22:32 ` Re: pgsql: Add pg_noinline macro to c.h. Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-10-13 22:43 ` Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 3+ messages in thread
From: Andres Freund @ 2017-10-13 22:43 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers
On 2017-10-13 18:32:08 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > Add pg_noinline macro to c.h.
>
> I think you want this to be parenthesized so that pgindent doesn't
> go nuts when you use it. At least, that was the reason why
> pg_attribute_noreturn() has parens. Even if the current version
> of pgindent doesn't have that problem
The current pgindent actually generates *better* layout with pg_noinline
rather than pg_noinline(). The latter forces a linebreak both in
declarations and definitions like:
static pg_noinline()
HeapTuple SearchCatCacheMiss(CatCache *cache,
static pg_noinline()
HeapTuple
SearchCatCacheMiss(CatCache *cache,
One difference to pg_attribute_noreturn() is that for function
definitions - and noinline needs to be present there IME - you can't put
it after the parameter list.
> I would argue that consistency demands that you spell this pg_attribute_noinline().
Hm, I personally find inline vs pg_noinline more aesthetically pleasing.
Greetings,
Andres Freund
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2017-10-13 22:43 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-10-13 21:29 pgsql: Add pg_noinline macro to c.h. Andres Freund <andres@anarazel.de>
2017-10-13 22:32 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-10-13 22:43 ` Andres Freund <andres@anarazel.de>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox