mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: build with clang-3.4 warnings report
Date: Sun, 6 Apr 2014 12:49:07 -0400	[thread overview]
Message-ID: <20140406164906.GZ26358@brightrain.aerifal.cx> (raw)
In-Reply-To: <1396802239.11744.385.camel@eris.loria.fr>

On Sun, Apr 06, 2014 at 06:37:19PM +0200, Jens Gustedt wrote:
> Am Samstag, den 05.04.2014, 21:57 -0400 schrieb Rich Felker:
> > As usual you're the master of preprocessor tricks. Overall I like it,
> > but it's still not as efficient as what we have now.
> 
> If space efficiency is really as important, you could be thinking of
> compressing all that strings, there is a lot of redundancy in the
> text.

*sigh* This was all discussed in the last bikeshed.

Compressing it just moves all the size from shared text to non-shared
data, not to mention adding the code size of a decompressor. And you
can't just decompress one string at a time in a small buffer because
the contract of musl's strerror is that the returned string is
immutable/permanently valid. This is necessary to make implementing
printf, strerror_r, etc. in terms of strerror possible, which in turn
is needed to make them efficient (otherwise you need a horrible retry
loop dynamically allocating larger buffer space, etc.)

The question is not whether space efficiency is really important, but
whether there's a justification for enlarging a function when the
increase in size has no practical benefits. And I think a majority of
our users would say the answer is no.

I agree that your version is mildly more elegant, and if I'd thought
of it first that's probably what I would have used from the beginning,
but I can't see explaining to users a size increase for the sake of
mild elegance.

Rich


  reply	other threads:[~2014-04-06 16:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04 19:59 Abdoulaye Walsimou Gaye
2014-04-04 20:47 ` Rich Felker
2014-04-05  1:06   ` Abdoulaye Walsimou Gaye
2014-04-05  1:54     ` Rich Felker
2014-04-05  9:04       ` Jens Gustedt
2014-04-05  9:31         ` Szabolcs Nagy
2014-04-05 13:07         ` Rich Felker
2014-04-05 14:37           ` Jens Gustedt
2014-04-05 16:35             ` Rich Felker
2014-04-05 22:08               ` Jens Gustedt
2014-04-06  1:57                 ` Rich Felker
2014-04-06 16:37                   ` Jens Gustedt
2014-04-06 16:49                     ` Rich Felker [this message]
2014-04-07 11:17       ` Oliver Schneider
2014-04-07 17:23         ` Rich Felker
2014-04-07 19:40           ` Abdoulaye Walsimou Gaye

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=20140406164906.GZ26358@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --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).