diff options
author | Karl Williamson <public@khwilliamson.com> | 2014-01-16 10:23:31 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2014-01-16 10:53:05 -0700 |
commit | dbfdbd2685aa055f4e4a3b9cb568635771805959 (patch) | |
tree | 971ad7e5194c32680433471aa72b1629b2249c65 /utf8.c | |
parent | c0c03436e9533fd23f6ff162659efff572844687 (diff) | |
download | perl-dbfdbd2685aa055f4e4a3b9cb568635771805959.tar.gz |
Turn on read-only flag for some unchangeable inversion lists
These lists are read-only. Turning on the flag may allow some
optimisations to be done, including some that may be added in the
future.
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2735,6 +2735,8 @@ Perl__core_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 m else SvREFCNT_inc_simple_void_NN(swash_invlist); } + SvREADONLY_on(swash_invlist); + /* Use the inversion list stand-alone if small enough */ if ((int) _invlist_len(swash_invlist) <= invlist_swash_boundary) { SvREFCNT_dec(retval); @@ -3840,6 +3842,7 @@ Perl__swash_to_invlist(pTHX_ SV* const swash) sv_free(other); /* through with it! */ } + SvREADONLY_on(invlist); return invlist; } |