summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2006-12-05 17:13:36 +0100
committerNicholas Clark <nick@ccl4.org>2007-03-30 20:04:34 +0000
commit504e95913d38271590d075feaadc7e0c1636c3e1 (patch)
tree6f1feec4765cd5207b90a4b4a26007841eb1718b /regcomp.h
parentff405b7394b66365d9c93cd5e3fb79977d8f5321 (diff)
downloadperl-504e95913d38271590d075feaadc7e0c1636c3e1.tar.gz
Integrate:
[ 29468] Subject: [PATCH] Further tweaks to make it easier to create regexp engine plug ins. Date: Tue, 5 Dec 2006 16:13:36 +0100 Message-ID: <9b18b3110612050713g77cac516x46fb5baac99b47c9@mail.gmail.com> (with tweaks) [ 29472] Subject: Re: [PATCH] Further tweaks to make it easier to create regexp engine plug ins. From: demerphq <demerphq@gmail.com> Message-ID: <9b18b3110612051353k7745792byabfdf98e18eb48c9@mail.gmail.com> Date: Tue, 5 Dec 2006 22:53:48 +0100 Fixes a minor bug in change 29468. [ 30740] It's possible to write the dup of struct reg_substr_datum with a memcpy() replacing the member by member copy. Curiously gcc's -Os produces the same sized code, but not all optimisers may manage this. Also, by reading and re-assigning to the copied data for the sv_dup()s we hope to avoid any cache misses on the copied from data. [ 30755] Looks like re_dup has been leaking references on 2 SVs for most regexps since dot (only to be recovered for certain at thread exit). p4raw-link: @30755 on //depot/perl: 32cd70f676ffca4ff7975bb5df57d2566f8443d3 p4raw-link: @30740 on //depot/perl: a86a1ca71b6cc69a4a01c17f91f95d556810d9f3 p4raw-link: @29472 on //depot/perl: c945c1810ac7d1d6f3bbb2bac095910a49e5b98a p4raw-link: @29468 on //depot/perl: 785a26d510947a2b97507d7acf9b8c13bd59b310 p4raw-id: //depot/maint-5.8/perl@30796 p4raw-integrated: from //depot/perl@29472 'edit in' regcomp.c (@29468..) p4raw-integrated: from //depot/perl@29468 'edit in' regcomp.h regexp.h (@29459..)
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/regcomp.h b/regcomp.h
index be2924b3d5..382da3bd33 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -72,6 +72,11 @@ typedef OP OP_4tree; /* Will be redefined later. */
* stored negative.]
*/
+/* This is the stuff that used to live in regexp.h that was truly
+ private to the engine itself. It now lives here. */
+
+/* this is where the old regcomp.h started */
+
struct regnode_string {
U8 str_len;
U8 type;
@@ -402,17 +407,6 @@ struct reg_data {
/* Code in S_to_utf8_substr() and S_to_byte_substr() in regexec.c accesses
anchored* and float* via array indexes 0 and 1. */
-struct reg_substr_datum {
- I32 min_offset;
- I32 max_offset;
- SV *substr; /* non-utf8 variant */
- SV *utf8_substr; /* utf8 variant */
-};
-
-struct reg_substr_data {
- struct reg_substr_datum data[3]; /* Actual array */
-};
-
#define anchored_substr substrs->data[0].substr
#define anchored_utf8 substrs->data[0].utf8_substr
#define anchored_offset substrs->data[0].min_offset