On Thu, Jan 20, 2022 at 5:09 AM <yla...@apache.org> wrote:
>
> Author: ylavic
> Date: Thu Jan 20 11:09:34 2022
> New Revision: 1897240
>
> URL: http://svn.apache.org/viewvc?rev=1897240&view=rev
> Log:
> ap_regex: Use Thread Local Storage (if efficient) to avoid allocations.
>
> PCRE2 wants an opaque context by providing the API to allocate and free it, so
> to minimize these calls we maintain one opaque context per thread (in Thread
> Local Storage, TLS) grown as needed, and while at it we do the same for PCRE1
> ints vectors. Note that this requires a fast TLS mechanism to be worth it,
> which is the case of apr_thread_data_get/set() from/to apr_thread_current()
> when APR_HAS_THREAD_LOCAL; otherwise we'll do the allocation and freeing for
> each ap_regexec().
>
> The small stack vector is used for PCRE1 && !APR_HAS_THREAD_LOCAL only now.

It's good to keep iterating on this, for now, but when I wrote the
patch both pcre1 & pcre2
were supported by an author, if not a whole community.

I don't believe the project can or should ship support for httpd
2.6/3.0/next with support
for a dead library. But it's better not to rip it out just yet.

pcre1 is very dangerous, on stack. pcre2 is highly cautioned against
using stack for
its arrays, by its author. We should heed the advice.

And I'm not a voting participant so take my observations, with both
grains of salt.

Cheers,

Bill

Reply via email to