Subject: Re: bug#58558: 29.0.50; re-search-forward is slow in some buffers

From: Eli Zaretskii <[email-masked]>
Date: Tue, 11 Apr 2023 14:51:14 +0300

> From: Ihor Radchenko <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>, [email-masked], [email-masked]
> Date: Tue, 11 Apr 2023 11:29:26 +0000
> 
> Well. I just tried, but my Emacs-C foo is not good enough.
> The attached patch fails to compile.

That's because you've put DEFVAR_INT outside of any function.  They
should be inside one of the syms_of_* functions instead.
regex-emacs.c doesn't have such a function, but search.c does.  So
just move those DEFVAR_INT lines to syms_of_search, and I think it
will work.