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

From: "Robert Haas" <robertmhaas(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Bruce Momjian" <bruce(at)momjian(dot)us>, "KaiGai Kohei" <kaigai(at)ak(dot)jp(dot)nec(dot)com>, "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>, simon(at)2ndquadrant(dot)com
Subject: Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)
Date: 2009-01-14 15:15:46
Message-ID: 603c8f070901140715k4aa7f517ja4fc8acc876ae7dc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 14, 2009 at 10:00 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Bruce Momjian <bruce(at)momjian(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2009-01-14 15:29:18 Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)
Previous Message Alvaro Herrera 2009-01-14 15:15:21 Re: reloptions with a "namespace"