public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org,  Nicolas Saenz Julienne <nsaenzju@redhat.com>
Subject: Re: [PATCH 2/3] linux: Simplify get_nprocs
Date: Tue, 07 Sep 2021 11:30:57 +0200	[thread overview]
Message-ID: <87mtoovijy.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20210906181133.1401140-3-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Mon, 6 Sep 2021 15:11:32 -0300")

* Adhemerval Zanella:

> +  /* This cannot use malloc because it is used on malloc initialization.  */
> +  enum { max_num_cpus = 32768 };
> +  size_t cpu_bits_size = CPU_ALLOC_SIZE (max_num_cpus);
> +  __cpu_mask cpu_bits[cpu_bits_size / sizeof (__cpu_mask)];

I think cpu_bits_size should be an enum constant as well, to avoid
creating a VLA.

Thanks,
Florian


  reply	other threads:[~2021-09-07  9:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06 18:11 [PATCH 0/3] Revert the use of sched_getaffinity on get_nproc Adhemerval Zanella
2021-09-06 18:11 ` [PATCH 1/3] misc: Add __get_nprocs_sched Adhemerval Zanella
2021-09-06 18:11 ` [PATCH 2/3] linux: Simplify get_nprocs Adhemerval Zanella
2021-09-07  9:30   ` Florian Weimer [this message]
2021-09-07 12:05     ` Adhemerval Zanella
2021-09-07  9:44   ` Florian Weimer
2021-09-06 18:11 ` [PATCH 3/3] linux: Revert the use of sched_getaffinity on get_nproc (BZ #28310) Adhemerval Zanella
2021-09-07  9:45   ` Florian Weimer
2021-09-07 12:12     ` 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=87mtoovijy.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=nsaenzju@redhat.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.
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).