Re: Updates of SE-PostgreSQL 8.4devel patches (r1403) - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)
Date
Msg-id 603c8f070901140715k4aa7f517ja4fc8acc876ae7dc@mail.gmail.com
Whole thread Raw
In response to Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
On Wed, Jan 14, 2009 at 10:00 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Bruce Momjian <bruce@momjian.us> writes:
>> KaiGai Kohei wrote:
>>> However, it also seems to me that PostgreSQL implementation tend to
>>> avoid to use inline functions actively.
>
>> I thought one advantage of using macros is that we force the inlining,
>
> The (only) good thing about macros is they're portable: they work,
> and work the same, on every C compiler.  This cannot be said of "inline".

Just out of curiosity, does C89, or whatever standard we follow, allow this?

int
somefunc(int x)
{   int foo[x];   /* use foo[] for scratch space */
}

Obviously this is a bad plan if x can be a big number because you
might crash your stack, but suppose we know that's not an issue?  It
seems a shame to have to do palloc/pfree in a situation like this.

...Robert


pgsql-hackers by date:

Previous
From: KaiGai Kohei
Date:
Subject: Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)
Next
From: Alvaro Herrera
Date:
Subject: Re: reloptions with a "namespace"