diff options
author | David Mitchell <davem@iabyn.com> | 2013-05-30 23:44:53 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-06-02 22:28:53 +0100 |
commit | 331b2dcc3fd1fd971f7a6ed1192c36ceaa0d6a88 (patch) | |
tree | d08aaa8da34abe810163dd16a494b4af38c390d8 /regexp.h | |
parent | bf2039a952dec80d770a6793104c0280373be103 (diff) | |
download | perl-331b2dcc3fd1fd971f7a6ed1192c36ceaa0d6a88.tar.gz |
use new cleanup for PL_regmatch_state
The previous commit reorganised state save and cleanup at the end of regex
execution. Use this new mechanism, by recording the original values
of PL_regmatch_slab and PL_regmatch_state in the regmatch_info_aux struct,
and restoring them and freeing higher slabs as part of the general
S_cleanup_regmatch_info_aux() destructor, rather than pushing the old
values directly onto the savestack and using another specific destructor.
Also, make the initial allocating of (up to) 3 PL_regmatch_state slots
more efficient by doing it in a loop.
We also skip the first slot; this may already be in use if we're called
reentrantly.
try 1
Diffstat (limited to 'regexp.h')
-rw-r--r-- | regexp.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -576,6 +576,8 @@ get_regex_charset_name(const U32 flags, STRLEN* const lenp) #define FBMrf_MULTILINE 1 +struct regmatch_state; +struct regmatch_slab; /* like regmatch_info_aux, but contains extra fields only needed if the * pattern contains (?{}). If used, is snuck into the second slot in the @@ -602,6 +604,8 @@ typedef struct { typedef struct { regmatch_info_aux_eval *info_aux_eval; + struct regmatch_state *old_regmatch_state; /* saved PL_regmatch_state */ + struct regmatch_slab *old_regmatch_slab; /* saved PL_regmatch_slab */ } regmatch_info_aux; |