Skip to content

Commit e80a011

Browse files
committed
Move case change invlists from interpreter to global
These are now constant through the life of the program, so don't need to be duplicated at each new thread instantiation.
1 parent 5174a82 commit e80a011

File tree

6 files changed

+25
-26
lines changed

6 files changed

+25
-26
lines changed

embedvar.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,6 @@
341341
#define PL_utf8_foldclosures (vTHX->Iutf8_foldclosures)
342342
#define PL_utf8_mark (vTHX->Iutf8_mark)
343343
#define PL_utf8_swash_ptrs (vTHX->Iutf8_swash_ptrs)
344-
#define PL_utf8_tofold (vTHX->Iutf8_tofold)
345-
#define PL_utf8_tolower (vTHX->Iutf8_tolower)
346-
#define PL_utf8_tosimplefold (vTHX->Iutf8_tosimplefold)
347-
#define PL_utf8_totitle (vTHX->Iutf8_totitle)
348-
#define PL_utf8_toupper (vTHX->Iutf8_toupper)
349344
#define PL_utf8cache (vTHX->Iutf8cache)
350345
#define PL_utf8locale (vTHX->Iutf8locale)
351346
#define PL_warn_locale (vTHX->Iwarn_locale)
@@ -478,6 +473,16 @@
478473
#define PL_Gutf8_perl_idcont (my_vars->Gutf8_perl_idcont)
479474
#define PL_utf8_perl_idstart (my_vars->Gutf8_perl_idstart)
480475
#define PL_Gutf8_perl_idstart (my_vars->Gutf8_perl_idstart)
476+
#define PL_utf8_tofold (my_vars->Gutf8_tofold)
477+
#define PL_Gutf8_tofold (my_vars->Gutf8_tofold)
478+
#define PL_utf8_tolower (my_vars->Gutf8_tolower)
479+
#define PL_Gutf8_tolower (my_vars->Gutf8_tolower)
480+
#define PL_utf8_tosimplefold (my_vars->Gutf8_tosimplefold)
481+
#define PL_Gutf8_tosimplefold (my_vars->Gutf8_tosimplefold)
482+
#define PL_utf8_totitle (my_vars->Gutf8_totitle)
483+
#define PL_Gutf8_totitle (my_vars->Gutf8_totitle)
484+
#define PL_utf8_toupper (my_vars->Gutf8_toupper)
485+
#define PL_Gutf8_toupper (my_vars->Gutf8_toupper)
481486
#define PL_utf8_xidcont (my_vars->Gutf8_xidcont)
482487
#define PL_Gutf8_xidcont (my_vars->Gutf8_xidcont)
483488
#define PL_utf8_xidstart (my_vars->Gutf8_xidstart)

intrpvar.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,14 +645,8 @@ PERLVAR(I, InBitmap, SV *)
645645

646646
/* utf8 character class swashes */
647647
PERLVAR(I, utf8_mark, SV *)
648-
PERLVAR(I, utf8_toupper, SV *)
649-
PERLVAR(I, utf8_totitle, SV *)
650-
PERLVAR(I, utf8_tolower, SV *)
651-
PERLVAR(I, utf8_tofold, SV *)
652-
PERLVAR(I, utf8_tosimplefold, SV *)
653648
PERLVAR(I, utf8_charname_begin, SV *)
654649
PERLVAR(I, utf8_charname_continue, SV *)
655-
656650
PERLVARA(I, utf8_swash_ptrs, POSIX_SWASH_COUNT, SV *)
657651
PERLVAR(I, seen_deprecated_macro, HV *)
658652

perl.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,22 +1199,12 @@ perl_destruct(pTHXx)
11991199
PL_utf8_swash_ptrs[i] = NULL;
12001200
}
12011201
SvREFCNT_dec(PL_utf8_mark);
1202-
SvREFCNT_dec(PL_utf8_toupper);
1203-
SvREFCNT_dec(PL_utf8_totitle);
1204-
SvREFCNT_dec(PL_utf8_tolower);
1205-
SvREFCNT_dec(PL_utf8_tofold);
1206-
SvREFCNT_dec(PL_utf8_tosimplefold);
12071202
SvREFCNT_dec(PL_utf8_foldclosures);
12081203
SvREFCNT_dec(PL_InBitmap);
12091204
#ifdef USE_LOCALE_CTYPE
12101205
SvREFCNT_dec(PL_warn_locale);
12111206
#endif
12121207
PL_utf8_mark = NULL;
1213-
PL_utf8_toupper = NULL;
1214-
PL_utf8_totitle = NULL;
1215-
PL_utf8_tolower = NULL;
1216-
PL_utf8_tofold = NULL;
1217-
PL_utf8_tosimplefold = NULL;
12181208
PL_utf8_foldclosures = NULL;
12191209
PL_InBitmap = NULL;
12201210
#ifdef USE_LOCALE_CTYPE

perlapi.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,16 @@ END_EXTERN_C
215215
#define PL_utf8_perl_idcont (*Perl_Gutf8_perl_idcont_ptr(NULL))
216216
#undef PL_utf8_perl_idstart
217217
#define PL_utf8_perl_idstart (*Perl_Gutf8_perl_idstart_ptr(NULL))
218+
#undef PL_utf8_tofold
219+
#define PL_utf8_tofold (*Perl_Gutf8_tofold_ptr(NULL))
220+
#undef PL_utf8_tolower
221+
#define PL_utf8_tolower (*Perl_Gutf8_tolower_ptr(NULL))
222+
#undef PL_utf8_tosimplefold
223+
#define PL_utf8_tosimplefold (*Perl_Gutf8_tosimplefold_ptr(NULL))
224+
#undef PL_utf8_totitle
225+
#define PL_utf8_totitle (*Perl_Gutf8_totitle_ptr(NULL))
226+
#undef PL_utf8_toupper
227+
#define PL_utf8_toupper (*Perl_Gutf8_toupper_ptr(NULL))
218228
#undef PL_utf8_xidcont
219229
#define PL_utf8_xidcont (*Perl_Gutf8_xidcont_ptr(NULL))
220230
#undef PL_utf8_xidstart

perlvars.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,8 @@ PERLVAR(G, utf8_xidcont, SV *)
295295
PERLVAR(G, utf8_xidstart, SV *)
296296
PERLVAR(G, WB_invlist, SV *)
297297
PERLVARA(G, XPosix_ptrs, POSIX_CC_COUNT, SV *)
298+
PERLVAR(G, utf8_toupper, SV *)
299+
PERLVAR(G, utf8_totitle, SV *)
300+
PERLVAR(G, utf8_tolower, SV *)
301+
PERLVAR(G, utf8_tofold, SV *)
302+
PERLVAR(G, utf8_tosimplefold, SV *)

sv.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15592,11 +15592,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
1559215592
}
1559315593
PL_seen_deprecated_macro = hv_dup_inc(proto_perl->Iseen_deprecated_macro, param);
1559415594
PL_utf8_mark = sv_dup_inc(proto_perl->Iutf8_mark, param);
15595-
PL_utf8_toupper = sv_dup_inc(proto_perl->Iutf8_toupper, param);
15596-
PL_utf8_totitle = sv_dup_inc(proto_perl->Iutf8_totitle, param);
15597-
PL_utf8_tolower = sv_dup_inc(proto_perl->Iutf8_tolower, param);
15598-
PL_utf8_tofold = sv_dup_inc(proto_perl->Iutf8_tofold, param);
15599-
PL_utf8_tosimplefold = sv_dup_inc(proto_perl->Iutf8_tosimplefold, param);
1560015595
PL_utf8_charname_begin = sv_dup_inc(proto_perl->Iutf8_charname_begin, param);
1560115596
PL_utf8_charname_continue = sv_dup_inc(proto_perl->Iutf8_charname_continue, param);
1560215597

0 commit comments

Comments
 (0)