From: "Ondřej Bílka" <neleai@seznam.cz>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
Florian Weimer <fweimer@redhat.com>,
libc-alpha@sourceware.org
Subject: Re: [PATCH] libio: Add small optimization on fmemopen
Date: Fri, 23 Sep 2016 05:17:00 -0000 [thread overview]
Message-ID: <20160923051720.GA22046@domone.kolej.mff.cuni.cz> (raw)
In-Reply-To: <cf7a6ec8-17fe-18d7-13b7-1ffe9342c4cf@cs.ucla.edu>
On Wed, Sep 21, 2016 at 11:43:23AM -0700, Paul Eggert wrote:
> On 09/21/2016 11:26 AM, Adhemerval Zanella wrote:
> >my idea to use this workaround is
> >to avoid possible issues with faulty compilers.
>
> That's my thought as well. Although we can argue that the C
> standard, GCC, valgrind, etc. are all faulty, possibly the C
> standard etc. won't change (after all, there is a performance
> advantage to GCC's current behavior) and our code would continue to
> be over the edge.
>
> We could document this more clearly by having a macro
> FLEXMEMBER_NEEDS_ALIGNMENT specifying whether flexible array member
> sizes require alignment. The default could be true to be safe for
> current platforms, and the macro could be false on (future?)
> platforms known to not require aligned allocation of flexible array
> members. Then we could say something like this:
>
> size_t clen = sizeof (fmemopen_cookie_t);
> if (FLEXMEMBER_NEEDS_ALIGNMENT)
> clen += _Alignof (fmemopen_cookie_t) - 1;
Couldn't you just use __attribute__((aligned(16))) or is that also
buggy?
next prev parent reply other threads:[~2016-09-23 5:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-21 14:06 Adhemerval Zanella
2016-09-21 14:57 ` Florian Weimer
2016-09-21 18:18 ` Adhemerval Zanella
2016-09-21 17:22 ` Paul Eggert
2016-09-21 18:17 ` Adhemerval Zanella
2016-09-21 18:23 ` Florian Weimer
2016-09-21 18:26 ` Adhemerval Zanella
2016-09-21 18:43 ` Paul Eggert
2016-09-21 18:47 ` Florian Weimer
2016-09-21 18:57 ` Paul Eggert
2016-09-21 19:27 ` Florian Weimer
2016-09-21 20:16 ` Adhemerval Zanella
2016-09-21 20:42 ` Paul Eggert
2016-09-23 5:17 ` Ondřej Bílka [this message]
2016-09-23 5:34 ` Florian Weimer
2016-09-23 18:14 ` Ondřej Bílka
2016-09-23 20:38 ` Florian Weimer
2016-09-23 18:29 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160923051720.GA22046@domone.kolej.mff.cuni.cz \
--to=neleai@seznam.cz \
--cc=adhemerval.zanella@linaro.org \
--cc=eggert@cs.ucla.edu \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).