From: Alexander Monakov <amonakov@ispras.ru>
To: musl@lists.openwall.com
Subject: Re: [RFC PATCH] micro-optimize __procfdname
Date: Sat, 5 Mar 2016 20:30:46 +0300 (MSK) [thread overview]
Message-ID: <alpine.LNX.2.20.1603052028190.31711@monopod.intra.ispras.ru> (raw)
In-Reply-To: <alpine.LNX.2.20.1603051756100.31711@monopod.intra.ispras.ru>
On Sat, 5 Mar 2016, Alexander Monakov wrote:
> There's an option of returning a struct containing both a buffer and a
> pointer, but it's a bit worse code-size-wise and may be too magic:
>
> struct procfdname_ret {
> char *ptr, buf[procfdsize];
> } __procfdname_impl(unsigned fd);
>
> #define procfdname(fd) __procfdname_impl(fd).ptr
>
> ... and in __procfdname_impl assign a pointer to last filled position in
> retval.buf to retval.ptr.
Rich explained on IRC that it's not correct (thanks!), and I don't see a way
to unbreak it. Sorry for the noise.
Alexander
prev parent reply other threads:[~2016-03-05 17:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-21 11:41 Alexander Monakov
2016-03-05 5:24 ` Rich Felker
2016-03-05 5:42 ` Alexander Monakov
2016-03-05 5:56 ` Rich Felker
2016-03-05 6:14 ` Alexander Monakov
2016-03-05 6:20 ` Rich Felker
2016-03-05 6:35 ` Alexander Monakov
2016-03-05 15:13 ` Alexander Monakov
2016-03-05 17:30 ` Alexander Monakov [this message]
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=alpine.LNX.2.20.1603052028190.31711@monopod.intra.ispras.ru \
--to=amonakov@ispras.ru \
--cc=musl@lists.openwall.com \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).