Skip site navigation (1) Skip section navigation (2)

static-if-inline

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: static-if-inline
Date: 2012-10-08 15:52:11
Message-ID: 20121008155211.GA5702@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackers
The ilist patch from Andres Freund introduces a cute trick for defining
maybe-inline functions, which works regardless of whether the compiler
supports inlining, and eliminates the need to write the code twice
(first in the header and also the .c file.)  It's really quite a simple
thing, but the whole topic on inlining has generated a lot of debate.

So to remove that controversy out of said patch, here's a preliminary
one: get rid of duplicate definitions in sortsupport.c, list.c, mcxt.c
(which are currently defined as static inline in their respective
headers for compilers that support it, and as regular functions in the
.c files for those that don't).

What's being done in this patch is exactly what would be done in the
ilist code.  So if there are problems with this, please speak up.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment: static-if-inline.patch
Description: text/x-diff (9.6 KB)

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2012-10-08 15:54:13
Subject: Re: Add FET to Default and Europe.txt
Previous:From: Heikki LinnakangasDate: 2012-10-08 15:39:17
Subject: Re: Add FET to Default and Europe.txt

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group