summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2014-01-16 10:23:31 -0700
committerKarl Williamson <public@khwilliamson.com>2014-01-16 10:53:05 -0700
commitdbfdbd2685aa055f4e4a3b9cb568635771805959 (patch)
tree971ad7e5194c32680433471aa72b1629b2249c65 /utf8.c
parentc0c03436e9533fd23f6ff162659efff572844687 (diff)
downloadperl-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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/utf8.c b/utf8.c
index f4b9dc6109..1b198bf955 100644
--- a/utf8.c
+++ b/utf8.c
@@ -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;
}