diff options
author | Karl Williamson <khw@cpan.org> | 2019-11-24 20:48:54 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-11-26 19:38:14 -0700 |
commit | a8def808210e08cea0b7889fea7c5146b21af4ed (patch) | |
tree | 40bd3017953f36bf853b7dec6c07e818d1d3588e /perlapi.h | |
parent | e4b61f959ac649d109da4ede1fba8cfa793a79a4 (diff) | |
download | perl-a8def808210e08cea0b7889fea7c5146b21af4ed.tar.gz |
Move regex global variables to interpreter level
This is part of fixing gh #17154
This scenario from the ticket
(https://github.com/Perl/perl5/issues/17154#issuecomment-558877358)
shows why this fix is necessary:
main interpreter initializes PL_AboveLatin1 to an SV it owns
loads threads::lite and creates a new thread/interpreter which
initializes PL_AboveLatin1 to a SV owned by the new interpreter
threads::lite child interpreter finishes, freeing all of its SVs,
PL_AboveLatin1 is now invalid
main interpreter uses a regexp that relies on PL_AboveLatin1, dies
horribly.
By making these interpreter level variables, this is avoided. There is
extra copying, but it is just the SV headers, as the real data is kept
as static C arrays.
Diffstat (limited to 'perlapi.h')
-rw-r--r-- | perlapi.h | 62 |
1 files changed, 0 insertions, 62 deletions
@@ -99,40 +99,8 @@ END_EXTERN_C #else /* !PERL_CORE */ -#undef PL_AboveLatin1 -#define PL_AboveLatin1 (*Perl_GAboveLatin1_ptr(NULL)) -#undef PL_Assigned_invlist -#define PL_Assigned_invlist (*Perl_GAssigned_invlist_ptr(NULL)) -#undef PL_CCC_non0_non230 -#define PL_CCC_non0_non230 (*Perl_GCCC_non0_non230_ptr(NULL)) #undef PL_C_locale_obj #define PL_C_locale_obj (*Perl_GC_locale_obj_ptr(NULL)) -#undef PL_GCB_invlist -#define PL_GCB_invlist (*Perl_GGCB_invlist_ptr(NULL)) -#undef PL_HasMultiCharFold -#define PL_HasMultiCharFold (*Perl_GHasMultiCharFold_ptr(NULL)) -#undef PL_InBitmap -#define PL_InBitmap (*Perl_GInBitmap_ptr(NULL)) -#undef PL_InMultiCharFold -#define PL_InMultiCharFold (*Perl_GInMultiCharFold_ptr(NULL)) -#undef PL_LB_invlist -#define PL_LB_invlist (*Perl_GLB_invlist_ptr(NULL)) -#undef PL_Latin1 -#define PL_Latin1 (*Perl_GLatin1_ptr(NULL)) -#undef PL_Posix_ptrs -#define PL_Posix_ptrs (*Perl_GPosix_ptrs_ptr(NULL)) -#undef PL_Private_Use -#define PL_Private_Use (*Perl_GPrivate_Use_ptr(NULL)) -#undef PL_SB_invlist -#define PL_SB_invlist (*Perl_GSB_invlist_ptr(NULL)) -#undef PL_SCX_invlist -#define PL_SCX_invlist (*Perl_GSCX_invlist_ptr(NULL)) -#undef PL_UpperLatin1 -#define PL_UpperLatin1 (*Perl_GUpperLatin1_ptr(NULL)) -#undef PL_WB_invlist -#define PL_WB_invlist (*Perl_GWB_invlist_ptr(NULL)) -#undef PL_XPosix_ptrs -#define PL_XPosix_ptrs (*Perl_GXPosix_ptrs_ptr(NULL)) #undef PL_appctx #define PL_appctx (*Perl_Gappctx_ptr(NULL)) #undef PL_check @@ -163,8 +131,6 @@ END_EXTERN_C #define PL_hash_state (*Perl_Ghash_state_ptr(NULL)) #undef PL_hints_mutex #define PL_hints_mutex (*Perl_Ghints_mutex_ptr(NULL)) -#undef PL_in_some_fold -#define PL_in_some_fold (*Perl_Gin_some_fold_ptr(NULL)) #undef PL_keyword_plugin #define PL_keyword_plugin (*Perl_Gkeyword_plugin_ptr(NULL)) #undef PL_keyword_plugin_mutex @@ -247,36 +213,8 @@ END_EXTERN_C #define PL_user_def_props_aTHX (*Perl_Guser_def_props_aTHX_ptr(NULL)) #undef PL_user_prop_mutex #define PL_user_prop_mutex (*Perl_Guser_prop_mutex_ptr(NULL)) -#undef PL_utf8_charname_begin -#define PL_utf8_charname_begin (*Perl_Gutf8_charname_begin_ptr(NULL)) -#undef PL_utf8_charname_continue -#define PL_utf8_charname_continue (*Perl_Gutf8_charname_continue_ptr(NULL)) #undef PL_utf8_foldclosures #define PL_utf8_foldclosures (*Perl_Gutf8_foldclosures_ptr(NULL)) -#undef PL_utf8_idcont -#define PL_utf8_idcont (*Perl_Gutf8_idcont_ptr(NULL)) -#undef PL_utf8_idstart -#define PL_utf8_idstart (*Perl_Gutf8_idstart_ptr(NULL)) -#undef PL_utf8_mark -#define PL_utf8_mark (*Perl_Gutf8_mark_ptr(NULL)) -#undef PL_utf8_perl_idcont -#define PL_utf8_perl_idcont (*Perl_Gutf8_perl_idcont_ptr(NULL)) -#undef PL_utf8_perl_idstart -#define PL_utf8_perl_idstart (*Perl_Gutf8_perl_idstart_ptr(NULL)) -#undef PL_utf8_tofold -#define PL_utf8_tofold (*Perl_Gutf8_tofold_ptr(NULL)) -#undef PL_utf8_tolower -#define PL_utf8_tolower (*Perl_Gutf8_tolower_ptr(NULL)) -#undef PL_utf8_tosimplefold -#define PL_utf8_tosimplefold (*Perl_Gutf8_tosimplefold_ptr(NULL)) -#undef PL_utf8_totitle -#define PL_utf8_totitle (*Perl_Gutf8_totitle_ptr(NULL)) -#undef PL_utf8_toupper -#define PL_utf8_toupper (*Perl_Gutf8_toupper_ptr(NULL)) -#undef PL_utf8_xidcont -#define PL_utf8_xidcont (*Perl_Gutf8_xidcont_ptr(NULL)) -#undef PL_utf8_xidstart -#define PL_utf8_xidstart (*Perl_Gutf8_xidstart_ptr(NULL)) #undef PL_veto_cleanup #define PL_veto_cleanup (*Perl_Gveto_cleanup_ptr(NULL)) #undef PL_watch_pvx |