Re: [PATCH 04/16] Add embedded list interface (header only)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Peter Geoghegan <peter(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: [PATCH 04/16] Add embedded list interface (header only)
Date: 2012-06-25 19:59:25
Message-ID: 29283.1340654365@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> On Monday, June 25, 2012 05:57:51 PM Tom Lane wrote:
>> Well, my response is "no". I could see saying that we require (some) C99
>> features at this point, but not features that are in no standard, no
>> matter how popular gcc might be.

> Also, 'static inline' *is* C99 conforming as far as I can see?

Hmm. I went back and re-read the C99 spec, and it looks like most of
the headaches we had in the past with C99 inline are specific to the
case where you want an extern declaration to be available. For a
function that exists *only* as a static it might be all right. So maybe
I'm misremembering how well this would work. We'd have to be sure we
don't need any extern declarations, though.

Having said that, I'm still of the opinion that it's not so hard to deal
with that we should just blow off compilers where "inline" doesn't work
well. I have no sympathy at all for the "we'd need two copies"
argument. First off, if the code is at any risk whatsoever of changing
intra-major-release, it is not acceptable to inline it (there would be
inline copies in third-party modules where we couldn't ensure
recompilation). So that's going to force us to use this only in cases
where the code is small and stable enough that two copies aren't such
a big problem. Second, it's not that hard to set things up so there's
only one source-code copy, as was noted upthread.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2012-06-25 20:04:10 Re: Catalog/Metadata consistency during changeset extraction from wal
Previous Message Phil Sorber 2012-06-25 19:49:01 Re: libpq compression