summaryrefslogtreecommitdiff
path: root/utils.lst
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-10-30 09:44:26 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-10-30 12:36:45 -0700
commit8d919b0a35f2b57a6bed2f8355b25b19ac5ad0c5 (patch)
treedeaa4e227975359d48e1f5270ed0a82c53287875 /utils.lst
parentf3cb5c3120c59ad2b1843ec808acee239bae8250 (diff)
downloadperl-8d919b0a35f2b57a6bed2f8355b25b19ac5ad0c5.tar.gz
Allow regexp-to-pvlv assignment
Since the xpvlv and regexp structs conflict, we have to find somewhere else to put the regexp struct. I was going to sneak it in SvPVX, allocating a buffer large enough to fit the regexp struct followed by the string, and have SvPVX - sizeof(regexp) point to the struct. But that would make all regexp flag-checking macros fatter, and those are used in hot code. So I came up with another method. Regexp stringification is not speed-critical. So we can move the regexp stringification out of re->sv_u and put it in the regexp struct. Then the regexp struct itself can be pointed to by re->sv_u. So SVt_REGEXPs will have re->sv_any and re->sv_u pointing to the same spot. PVLVs can then have sv->sv_any point to the xpvlv body as usual, but have sv->sv_u point to a regexp struct. All regexp member access can go through sv_u instead of sv_any, which will be no slower than before. Regular expressions will no longer be SvPOK, so we give sv_2pv spec- ial logic for regexps. We don’t need to make the regexp struct larger, as SvLEN is currently always 0 iff mother_re is set. So we can replace the SvLEN field with the pv. SvFAKE is never used without SvPOK or SvSCREAM also set. So we can use that to identify regexps.
Diffstat (limited to 'utils.lst')
0 files changed, 0 insertions, 0 deletions