From 744ebf52f3e4ca5e41d9ce8bc68e10cae14592a0 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Tue, 13 Mar 2018 21:52:15 -0600 Subject: Make Unicode data structures global These structures are read-only, use const C strings, and are truly global, so no need to have them be interpreter level. This saves duplicating and freeing them as threads come and go. In doing this, I noticed that not every one was properly being copied/deallocated, so this fixes some potential unreported bugs, and leaks. --- perlapi.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'perlapi.h') diff --git a/perlapi.h b/perlapi.h index b39c8ccd04..f882f6b840 100644 --- a/perlapi.h +++ b/perlapi.h @@ -99,8 +99,32 @@ 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_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_LB_invlist +#define PL_LB_invlist (*Perl_GLB_invlist_ptr(NULL)) +#undef PL_Latin1 +#define PL_Latin1 (*Perl_GLatin1_ptr(NULL)) +#undef PL_NonL1NonFinalFold +#define PL_NonL1NonFinalFold (*Perl_GNonL1NonFinalFold_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 @@ -181,6 +205,20 @@ END_EXTERN_C #define PL_timesbase (*Perl_Gtimesbase_ptr(NULL)) #undef PL_use_safe_putenv #define PL_use_safe_putenv (*Perl_Guse_safe_putenv_ptr(NULL)) +#undef PL_utf8_foldable +#define PL_utf8_foldable (*Perl_Gutf8_foldable_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_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_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 -- cgit v1.2.1