summaryrefslogtreecommitdiff
path: root/regexp.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-05 21:33:30 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-05 21:33:30 +0000
commit08e447406761619260203dbbef9cf10b6efa533c (patch)
tree0ecbcc7b50cf5cb76a4982389bdb6962475f8be0 /regexp.h
parentd0a30c4343e6b989663db0abe44ac1e4c2820428 (diff)
downloadperl-08e447406761619260203dbbef9cf10b6efa533c.tar.gz
Don't allocate the NV slot for SVt_REGEXP.
p4raw-id: //depot/perl@32859
Diffstat (limited to 'regexp.h')
-rw-r--r--regexp.h75
1 files changed, 42 insertions, 33 deletions
diff --git a/regexp.h b/regexp.h
index ad59cc7346..7696ec25b8 100644
--- a/regexp.h
+++ b/regexp.h
@@ -66,44 +66,53 @@ typedef struct regexp_paren_pair {
regexp's data array based on the data item's type.
*/
+#define _REGEXP_COMMON \
+ /* what engine created this regexp? */ \
+ const struct regexp_engine* engine; \
+ REGEXP *mother_re; /* what re is this a lightweight copy of? */ \
+ /* Information about the match that the perl core uses to */ \
+ /* manage things */ \
+ U32 extflags; /* Flags used both externally and internally */ \
+ I32 minlen; /* mininum possible length of string to match */\
+ I32 minlenret; /* mininum possible length of $& */ \
+ U32 gofs; /* chars left of pos that we search from */ \
+ /* substring data about strings that must appear in the */ \
+ /* final match, used for optimisations */ \
+ struct reg_substr_data *substrs; \
+ U32 nparens; /* number of capture buffers */ \
+ /* private engine specific data */ \
+ U32 intflags; /* Engine Specific Internal flags */ \
+ void *pprivate; /* Data private to the regex engine which */ \
+ /* created this object. */ \
+ /* Data about the last/current match. These are modified */ \
+ /* during matching */ \
+ U32 lastparen; /* last open paren matched */ \
+ U32 lastcloseparen; /* last close paren matched */ \
+ regexp_paren_pair *swap; /* Swap copy of *offs */ \
+ /* Array of offsets for (@-) and (@+) */ \
+ regexp_paren_pair *offs; \
+ /* saved or original string so \digit works forever. */ \
+ char *subbeg; \
+ SV_SAVED_COPY /* If non-NULL, SV which is COW from original */\
+ I32 sublen; /* Length of string pointed by subbeg */ \
+ /* Information about the match that isn't often used */ \
+ /* offset from wrapped to the start of precomp */ \
+ unsigned pre_prefix:4; \
+ /* number of eval groups in the pattern - for security checks */\
+ unsigned seen_evals:28
+
typedef struct regexp {
_XPV_HEAD;
_XPVMG_HEAD;
- /* what engine created this regexp? */
- const struct regexp_engine* engine;
- REGEXP *mother_re; /* what re is this a lightweight copy of? */
-
- /* Information about the match that the perl core uses to manage things */
- U32 extflags; /* Flags used both externally and internally */
- I32 minlen; /* mininum possible length of string to match */
- I32 minlenret; /* mininum possible length of $& */
- U32 gofs; /* chars left of pos that we search from */
- struct reg_substr_data *substrs; /* substring data about strings that must appear
- in the final match, used for optimisations */
- U32 nparens; /* number of capture buffers */
-
- /* private engine specific data */
- U32 intflags; /* Engine Specific Internal flags */
- void *pprivate; /* Data private to the regex engine which
- created this object. */
-
- /* Data about the last/current match. These are modified during matching*/
- U32 lastparen; /* last open paren matched */
- U32 lastcloseparen; /* last close paren matched */
- regexp_paren_pair *swap; /* Swap copy of *offs */
- regexp_paren_pair *offs; /* Array of offsets for (@-) and (@+) */
-
- char *subbeg; /* saved or original string
- so \digit works forever. */
- SV_SAVED_COPY /* If non-NULL, SV which is COW from original */
- I32 sublen; /* Length of string pointed by subbeg */
-
-
- /* Information about the match that isn't often used */
- 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 */
+ _REGEXP_COMMON;
} regexp;
+struct regexp_allocated {
+ _XPV_ALLOCATED_HEAD;
+ _XPVMG_HEAD;
+ _REGEXP_COMMON;
+};
+
/* HV *paren_names; Optional hash of paren names
now stored in the IV union */