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.