Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org, KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>, tgl(at)sss(dot)pgh(dot)pa(dot)us, simon(at)2ndQuadrant(dot)com
Subject: Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)
Date: 2009-01-14 14:46:19
Message-ID: 200901141446.n0EEkJc26930@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

KaiGai Kohei wrote:
> Martijn van Oosterhout wrote:
> > On Tue, Jan 13, 2009 at 10:05:45AM -0300, Alvaro Herrera wrote:
> >> pgace.h: you have a bunch of "static inline" functions in here. As far
> >> as I know this doesn't work in compilers other than GCC :-( See
> >> pg_list.h (list_head) for an example. I think we can tolerate this for
> >> the three functions in pg_list.h because they are so few and so tiny,
> >> but I'm not sure about PGACE because they are a large lot. On the other
> >> hand, turning them to real functions would be a performance hit.
> >
> > Really? C99 requires it and MSVC does support it. At least the other
> > compilers whose name I remembered (HP, Sun) support it also. I'd be
> > surprised if a compiler didn't since it's the form of inline that most
> > matches what people expect to happen.
> >
> > Do you have an example?
>
> I have no preference either of them, because it is not an essence of
> my patches whether its security hooks are implemented as inline, or not.
>
> IIRC, indeed, some of compiler also supported "static inline".
> However, it also seems to me that PostgreSQL implementation tend to
> avoid to use inline functions actively.
> For example, heap_getattr() and fastgetattr() are implemented as
> macros, even if they have a bit complex conditional branches, which
> can be rewritten more simple with inline functions.

I thought one advantage of using macros is that we force the inlining,
while I think inline compiler directives are more of a hint, but maybe
the compiler knows better than we do in some cases.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-01-14 14:52:20 Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)
Previous Message Emanuel Calvo Franco 2009-01-14 14:46:00 Re: inconsistency in aliasing