summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2016-11-12 14:48:52 +0000
committerDavid Mitchell <davem@iabyn.com>2016-11-12 16:15:09 +0000
commita5c7cb08f7954af4accf63bfffaab1bd61f1dd68 (patch)
tree2202d596d03070380f8708b9966805c814a59168 /util.c
parentb4204fb6f01f49bdf8ebb6d68e0f713a505f069a (diff)
downloadperl-a5c7cb08f7954af4accf63bfffaab1bd61f1dd68.tar.gz
eliminate SVpbm_VALID flag
This flag is set on an SV to indicate that it has PERL_MAGIC_bm (fast Boyer-Moore) magic attached. Instead just directly check whether it has such magic. This frees up the 0x40000000 bit for anything except AVs and HVs
Diffstat (limited to 'util.c')
-rw-r--r--util.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/util.c b/util.c
index e459a0c5da..fb2ddec974 100644
--- a/util.c
+++ b/util.c
@@ -731,21 +731,8 @@ Perl_fbm_compile(pTHX_ SV *sv, U32 flags)
SvUPGRADE(sv, SVt_PVMG);
SvIOK_off(sv);
SvNOK_off(sv);
- SvVALID_on(sv);
- /* "deep magic", the comment used to add. The use of MAGIC itself isn't
- really. MAGIC was originally added in 79072805bf63abe5 (perl 5.0 alpha 2)
- to call SvVALID_off() if the scalar was assigned to.
-
- The comment itself (and "deeper magic" below) date back to
- 378cc40b38293ffc (perl 2.0). "deep magic" was an annotation on
- str->str_pok |= 2;
- where the magic (presumably) was that the scalar had a BM table hidden
- inside itself.
-
- As MAGIC is always present on BMs [in Perl 5 :-)], we can use it to store
- the table instead of the previous (somewhat hacky) approach of co-opting
- the string buffer and storing it after the string. */
+ /* add PERL_MAGIC_bm magic holding the FBM lookup table */
assert(!mg_find(sv, PERL_MAGIC_bm));
mg = sv_magicext(sv, NULL, PERL_MAGIC_bm, &PL_vtbl_bm, NULL, 0);