This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Initialize some inversion lists at start-up.
authorKarl Williamson <khw@cpan.org>
Wed, 25 Jul 2018 01:16:46 +0000 (19:16 -0600)
committerKarl Williamson <khw@cpan.org>
Fri, 3 Aug 2018 18:55:01 +0000 (12:55 -0600)
The time it takes for these is trivial, since they are using compiled-in
Unicode values.

regcomp.c
utf8.c

index a44e730..4861ae1 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -21546,6 +21546,11 @@ Perl_init_uniprops(pTHX)
     PL_utf8_tosimplefold = _new_invlist_C_array(Simple_Case_Folding_invlist);
     PL_utf8_foldclosures = _new_invlist_C_array(_Perl_IVCF_invlist);
     PL_utf8_mark = _new_invlist_C_array(uni_prop_ptrs[UNI_M]);
+
+    /* The below are used only by deprecated functions.  They could be removed */
+    PL_utf8_xidcont  = _new_invlist_C_array(uni_prop_ptrs[UNI_XIDC]);
+    PL_utf8_idcont   = _new_invlist_C_array(uni_prop_ptrs[UNI_IDC]);
+    PL_utf8_xidstart = _new_invlist_C_array(uni_prop_ptrs[UNI_XIDS]);
 }
 
 SV *
diff --git a/utf8.c b/utf8.c
index 1734793..37cf914 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -3332,7 +3332,10 @@ Perl__is_utf8_xidstart(pTHX_ const U8 *p)
 
     if (*p == '_')
        return TRUE;
-    return is_utf8_common(p, &PL_utf8_xidstart, "XIdStart", NULL);
+
+    return is_utf8_common(p, NULL,
+                          "This is buggy if this gets used",
+                          PL_utf8_xidstart);
 }
 
 bool
@@ -3350,7 +3353,9 @@ Perl__is_utf8_idcont(pTHX_ const U8 *p)
 {
     PERL_ARGS_ASSERT__IS_UTF8_IDCONT;
 
-    return is_utf8_common(p, &PL_utf8_idcont, "IdContinue", NULL);
+    return is_utf8_common(p, NULL,
+                          "This is buggy if this gets used",
+                          PL_utf8_idcont);
 }
 
 bool
@@ -3358,7 +3363,9 @@ Perl__is_utf8_xidcont(pTHX_ const U8 *p)
 {
     PERL_ARGS_ASSERT__IS_UTF8_XIDCONT;
 
-    return is_utf8_common(p, &PL_utf8_xidcont, "XIdContinue", NULL);
+    return is_utf8_common(p, NULL,
+                          "This is buggy if this gets used",
+                          PL_utf8_xidcont);
 }
 
 bool