bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: bug-gnulib@gnu.org, libc-alpha@sourceware.org
Subject: Re: [PATCH 2/3] posix: Remove alloca usage on regex build_trtable
Date: Mon, 11 Jan 2021 09:31:51 -0300	[thread overview]
Message-ID: <1546c8d0-fd22-0e10-8f0d-2b6f1791f1c1@linaro.org> (raw)
In-Reply-To: <831a8e3b-7a4a-0c9a-418e-0656fc137765@cs.ucla.edu>



On 08/01/2021 19:30, Paul Eggert wrote:
> On 1/6/21 10:17 AM, Adhemerval Zanella wrote:
>> __libc_use_alloca/alloca is replaced with malloc regardless.
> 
> These allocations are so small that they should be put on the stack instead of using malloc. I did that in Gnulib by installing the attached patch. The idea is that the resulting regexec.c file should be copyable unchanged into glibc.
> 
> From a Gnulib point of view this code uses a 20 KiB frame (on a 64-bit host) which goes past the usual 4032-byte limit for stack frames, but I think we can stretch the point here.  In glibc the limit is 64 KiB so there's no problem.

Right, I think we can maybe use scratch_buffer for these or even a dynamic array
with a more proper initial size as an improvement.


  reply	other threads:[~2021-01-11 12:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 18:17 [PATCH 1/3] posix: Remove alloca usage on regex set_regs Adhemerval Zanella
2021-01-06 18:17 ` [PATCH 2/3] posix: Remove alloca usage on regex build_trtable Adhemerval Zanella
2021-01-08 22:30   ` Paul Eggert
2021-01-11 12:31     ` Adhemerval Zanella [this message]
2021-01-06 18:17 ` [PATCH 3/3] posix: Remove alloca definition from regex Adhemerval Zanella
2021-01-09  1:20   ` Paul Eggert
2021-01-11 12:33     ` Adhemerval Zanella
2021-01-08 20:14 ` [PATCH 1/3] posix: Remove alloca usage on regex set_regs Paul Eggert
2021-01-11 12:35   ` Adhemerval Zanella
2021-01-09  1:24 ` Darshit Shah
2021-01-09  3:54   ` Paul Eggert

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: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=1546c8d0-fd22-0e10-8f0d-2b6f1791f1c1@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=bug-gnulib@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --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).