git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] clean: use warning_errno() when appropriate
Date: Mon, 13 Feb 2017 12:38:47 -0800	[thread overview]
Message-ID: <xmqqk28tddwo.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170213191433.muwhz7zem64p3rxr@sigill.intra.peff.net> (Jeff King's message of "Mon, 13 Feb 2017 14:14:33 -0500")

Jeff King <peff@peff.net> writes:

> I wonder if xmalloc() should be the one doing the saved_errno trick.
> After all, it has only two outcomes: we successfully allocated the
> memory, or we called die().

I would be lying if I said I did not considered it when I wrote the
message you are responding to, but I rejected it because that would
be optimizing for a wrong case, in that most callers of xmalloc()
and friends do not do so in the error codepath, and we would be
penalizing them by doing the saved_errno dance unconditionally.


  reply	other threads:[~2017-02-13 20:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13  9:27 [PATCH] clean: use warning_errno() when appropriate Nguyễn Thái Ngọc Duy
2017-02-13 18:34 ` Junio C Hamano
2017-02-13 19:14   ` Jeff King
2017-02-13 20:38     ` Junio C Hamano [this message]
2017-02-13 21:10       ` Jeff King
2017-02-13 21:53         ` Junio C Hamano
2017-02-13 22:22           ` Jeff King
2017-02-13 23:48             ` Junio C Hamano
2017-02-14  9:54 ` [PATCH v2] " Nguyễn Thái Ngọc Duy
2017-02-14 18:13   ` Junio C Hamano
2017-02-15  0:49     ` Duy Nguyen
2017-02-15  1:28       ` Junio C Hamano
2017-02-15  1:36         ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqk28tddwo.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    /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://80x24.org/mirrors/git.git

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).