public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	libc-alpha@sourceware.org
Subject: Re: [PATCH v4 5/6] stdlib: Remove use of mergesort on qsort (BZ 21719)
Date: Wed, 12 Jul 2023 15:04:50 -0700	[thread overview]
Message-ID: <c845f090-13b3-542a-15cb-3c759b8ad9ef@cs.ucla.edu> (raw)
In-Reply-To: <20230711190722.4028821-6-adhemerval.zanella@linaro.org>

On 2023-07-11 12:07, Adhemerval Zanella via Libc-alpha wrote:
> @@ -152,6 +151,7 @@ pop (stack_node *top, char **lo, char **hi, size_t *depth)
>   static inline size_t
>   parent (size_t i, unsigned int lsbit, size_t size)
>   {
> +  /* The below is logically equivalent to 'if (i & lsbit) i -= size'.  */
>     i -= size;
>     i -= size & -(i & lsbit);
>     return i / 2;

Doesn't the comment belong to the patch that introduced this code, not 
to patch 5?

Also, it's not clear which of the three lines the phrase "The below" 
refers to. I assume it refers to the line "i -= size & -(i & lsbit);". 
If so, this should be made clearer, e.g.:

     i -= size;
     i -= size & -(i & lsbit); /* i.e., 'if (i & lsbit) i -= size;' */
     return i / 2;


  reply	other threads:[~2023-07-12 22:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 19:07 [PATCH v4 0/6] Use introsort for qsort Adhemerval Zanella
2023-07-11 19:07 ` [PATCH v4 1/6] stdlib: Optimization qsort{_r} swap implementation (BZ 19305) Adhemerval Zanella
2023-07-11 23:40   ` Noah Goldstein
2023-07-12 19:40     ` Adhemerval Zanella Netto
2023-07-12 21:04   ` Paul Eggert
2023-07-13 11:07     ` Adhemerval Zanella Netto
2023-07-13 13:13       ` Alexander Monakov
2023-07-13 13:29         ` Adhemerval Zanella Netto
2023-07-11 19:07 ` [PATCH v4 2/6] stdlib: Move insertion sort out qsort Adhemerval Zanella
2023-07-11 23:46   ` Noah Goldstein
2023-07-12  7:28     ` Andreas Schwab
2023-07-12 20:35     ` Adhemerval Zanella Netto
2023-07-11 19:07 ` [PATCH v4 3/6] stdlib: qsort: Move some macros to inline function Adhemerval Zanella
2023-07-11 23:44   ` Noah Goldstein
2023-07-12 20:45     ` Adhemerval Zanella Netto
2023-07-11 19:07 ` [PATCH v4 4/6] stdlib: Implement introsort with qsort Adhemerval Zanella
2023-07-12  5:39   ` Alexander Monakov
2023-07-12 20:55     ` Adhemerval Zanella Netto
2023-07-12 21:55   ` Paul Eggert
2023-07-13 11:53     ` Adhemerval Zanella Netto
2023-07-11 19:07 ` [PATCH v4 5/6] stdlib: Remove use of mergesort on qsort (BZ 21719) Adhemerval Zanella
2023-07-12 22:04   ` Paul Eggert [this message]
2023-07-13 11:55     ` Adhemerval Zanella Netto
2023-07-11 19:07 ` [PATCH v4 6/6] stdlib: Add more qsort{_r} coverage Adhemerval Zanella

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=c845f090-13b3-542a-15cb-3c759b8ad9ef@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=adhemerval.zanella@linaro.org \
    --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).