Re: Asynchronous and "direct" IO support for PostgreSQL.

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Melanie Plageman <melanieplageman(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Asynchronous and "direct" IO support for PostgreSQL.
Date: 2021-07-31 00:42:47
Message-ID: CA+hUKGJNVYvFDjU3cH2DGZPkzqBAi-xpja=3KvArPXS4yFqzoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jul 31, 2021 at 7:52 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2021-07-30 15:35:30 -0400, Melanie Plageman wrote:
> > * I think that having TBMIterateResult inside of TBMIterator is not
> > well-defined C language behavior. In [1], it says
> >
> > "Structures with flexible array members (or unions who have a
> > recursive-possibly structure member with flexible array member) cannot
> > appear as array elements or as members of other structures."
>
> > [1] https://en.cppreference.com/w/c/language/struct
>
> I think it is ok as long as the struct with the flexible array member is
> at the end of the struct it is embedded in. I think even by the letter
> of the standard, but it's as always hard to parse...

That's clearly the de facto situation (I think that was the case on
the most popular compilers long before flexible array members were
even standardised), but I think it might technically still be not
allowed since this change has not yet been accepted AFAICS:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2083.htm

In any case, we already do it which is why wrasse (Sun Studio
compiler) warns about indkey in pg_index.h. Curiously, indkey is not
always the final member of the containing struct, depending on
CATALOG_VARLEN...

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2021-07-31 01:08:03 Re: param 'txn' not used in function maybe_send_schema()
Previous Message Andres Freund 2021-07-31 00:09:56 Re: Replication protocol doc fix