summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-11-07 17:33:42 +0000
committerNicholas Clark <nick@ccl4.org>2010-11-08 07:55:10 +0000
commit84fea1848dbe5e79f7c9bbdddbf1e60fec8d3cc6 (patch)
tree88988a39fbd0d1be5d6f66261a212a1551a8b91b /ext
parentfdbacc68b1fcfb16fad5514e33e08c746c417f2d (diff)
downloadperl-84fea1848dbe5e79f7c9bbdddbf1e60fec8d3cc6.tar.gz
Merge the implementation of B::BM::TABLE with B::PV::{PV,PVX,PVBM} using ALIAS.
On this platform, this reduces the object code size by about .5K.
Diffstat (limited to 'ext')
-rw-r--r--ext/B/B.xs20
1 files changed, 7 insertions, 13 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs
index 3841655d23..9dd6d0691e 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -1619,12 +1619,18 @@ PV(sv)
ALIAS:
PVX = 1
PVBM = 2
+ B::BM::TABLE = 3
PREINIT:
const char *p;
STRLEN len = 0;
U32 utf8 = 0;
CODE:
- if (ix == 2) {
+ if (ix == 3) {
+ p = SvPV(sv, len);
+ /* Boyer-Moore table is just after string and its safety-margin \0 */
+ p += len + PERL_FBM_TABLE_OFFSET;
+ len = 256;
+ } else if (ix == 2) {
/* This used to read 257. I think that that was buggy - should have
been 258. (The "\0", the flags byte, and 256 for the table. Not
that anything anywhere calls this method. NWC. */
@@ -1733,18 +1739,6 @@ MOREMAGIC(mg)
break;
}
-MODULE = B PACKAGE = B::BM
-
-void
-TABLE(sv)
- B::BM sv
- STRLEN len = NO_INIT
- char * str = NO_INIT
- CODE:
- str = SvPV(sv, len);
- /* Boyer-Moore table is just after string and its safety-margin \0 */
- ST(0) = newSVpvn_flags(str + len + PERL_FBM_TABLE_OFFSET, 256, SVs_TEMP);
-
MODULE = B PACKAGE = B::GV PREFIX = Gv
void