diff options
author | Noam Postavsky <npostavs@gmail.com> | 2017-01-01 14:09:13 -0500 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2017-01-08 18:45:52 -0500 |
commit | 13c6f1d185d301aad2f6d756c148acb2edd0889f (patch) | |
tree | ac1df03118e312742b8a9fdf83698ad6b25eb869 /test/lisp/emacs-lisp/rx-tests.el | |
parent | 9a19f26cd796c7321f659a8dbea5296b0eeea51d (diff) | |
download | emacs-13c6f1d185d301aad2f6d756c148acb2edd0889f.tar.gz emacs-13c6f1d185d301aad2f6d756c148acb2edd0889f.tar.bz2 emacs-13c6f1d185d301aad2f6d756c148acb2edd0889f.zip |
Use expanded stack during regex matches
While the stack is increased in main(), to allow the regex stack
allocation to use alloca we also need to modify regex.c to actually take
advantage of the increased stack, and not limit stack allocations to
SAFE_ALLOCA bytes.
* src/regex.c (MATCH_MAY_ALLOCATE): Remove obsolete comment about
allocations in signal handlers which no longer happens and correct
description about when and why MATCH_MAY_ALLOCATE should be defined.
(emacs_re_safe_alloca): New variable.
(REGEX_USE_SAFE_ALLOCA): Use it as the limit of stack allocation instead
of MAX_ALLOCA.
(emacs_re_max_failures): Rename from `re_max_failures' to avoid
confusion with glibc's `re_max_failures'.
* src/emacs.c (main): Increase the amount of fixed 'extra' bytes we add
to the stack. Instead of changing emacs_re_max_failures based on the
new stack size, just change emacs_re_safe_alloca; emacs_re_max_failures
remains constant regardless, since if we run out stack space SAFE_ALLOCA
will fall back to heap allocation.
Co-authored-by: Eli Zaretskii <eliz@gnu.org>
Diffstat (limited to 'test/lisp/emacs-lisp/rx-tests.el')
0 files changed, 0 insertions, 0 deletions