summaryrefslogtreecommitdiff
path: root/regexp.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-12-28 22:19:00 +0000
committerNicholas Clark <nick@ccl4.org>2007-12-28 22:19:00 +0000
commit2c96c0d61ce80822b81de2248e48b10f0182d790 (patch)
tree04308778310b8943cb90138b157fdfe8d25591d2 /regexp.h
parent3a9b2cacfb08e1181b7d9ae45cad1ed8acd59972 (diff)
downloadperl-2c96c0d61ce80822b81de2248e48b10f0182d790.tar.gz
Eliminate precomp from struct regexp. Store the offset of precomp from
wrapped in pre_prefix, a 4 bit value. (Maybe only for now) reduce seen_evals from I32 to 28 bits. Will anyone have more than 268435456 eval groups in a regexp? p4raw-id: //depot/perl@32755
Diffstat (limited to 'regexp.h')
-rw-r--r--regexp.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/regexp.h b/regexp.h
index ce3a48528b..5b58697bf1 100644
--- a/regexp.h
+++ b/regexp.h
@@ -99,11 +99,11 @@ typedef struct regexp {
/* Information about the match that isn't often used */
I32 prelen; /* length of precomp */
- const char *precomp; /* pre-compilation regular expression */
/* wrapped can't be const char*, as it is returned by sv_2pv_flags */
char *wrapped; /* wrapped version of the pattern */
I32 wraplen; /* length of wrapped */
- I32 seen_evals; /* number of eval groups in the pattern - for security checks */
+ unsigned pre_prefix:4; /* offset from wrapped to the start of precomp */
+ unsigned seen_evals:28; /* number of eval groups in the pattern - for security checks */
HV *paren_names; /* Optional hash of paren names */
/* Refcount of this regexp */
@@ -354,7 +354,7 @@ and check for NULL.
: RX_MATCH_COPIED_off(prog))
/* For source compatibility. We used to store these explicitly. */
-#define RX_PRECOMP(prog) ((prog)->precomp)
+#define RX_PRECOMP(prog) ((prog)->wrapped + (prog)->pre_prefix)
#define RX_PRELEN(prog) ((prog)->prelen)
#endif /* PLUGGABLE_RE_EXTENSION */