do_hv_dump(level, file, " STASH", SvSTASH(sv));
if ((type == SVt_PVMG || type == SVt_PVLV) && SvVALID(sv)) {
- Perl_dump_indent(aTHX_ level, file, " RARE = %u\n", (U8)BmRARE(sv));
- Perl_dump_indent(aTHX_ level, file, " PREVIOUS = %"UVuf"\n", (UV)BmPREVIOUS(sv));
Perl_dump_indent(aTHX_ level, file, " USEFUL = %"IVdf"\n", (IV)BmUSEFUL(sv));
}
}
#define PVMG_stash_ix sv_SVp | offsetof(struct xpvmg, xmg_stash)
-#if PERL_VERSION > 14
+#if PERL_VERSION > 18
+# define PVBM_useful_ix sv_I32p | offsetof(struct xpvgv, xnv_u.xbm_useful)
+#elif PERL_VERSION > 14
# define PVBM_useful_ix sv_I32p | offsetof(struct xpvgv, xnv_u.xbm_s.xbm_useful)
-# define PVBM_previous_ix sv_UVp | offsetof(struct xpvuv, xuv_uv)
#else
#define PVBM_useful_ix sv_I32p | offsetof(struct xpvgv, xiv_u.xivu_i32)
-#define PVBM_previous_ix sv_U32p | offsetof(struct xpvgv, xnv_u.xbm_s.xbm_previous)
#endif
-#define PVBM_rare_ix sv_U8p | offsetof(struct xpvgv, xnv_u.xbm_s.xbm_rare)
-
#define PVLV_targoff_ix sv_U32p | offsetof(struct xpvlv, xlv_targoff)
#define PVLV_targlen_ix sv_U32p | offsetof(struct xpvlv, xlv_targlen)
#define PVLV_targ_ix sv_SVp | offsetof(struct xpvlv, xlv_targ)
B::GV::STASH = PVGV_stash_ix
B::GV::GvFLAGS = PVGV_flags_ix
B::BM::USEFUL = PVBM_useful_ix
- B::BM::PREVIOUS = PVBM_previous_ix
- B::BM::RARE = PVBM_rare_ix
B::IO::LINES = PVIO_lines_ix
B::IO::PAGE = PVIO_page_ix
B::IO::PAGE_LEN = PVIO_page_len_ix
break;
}
+MODULE = B PACKAGE = B::BM PREFIX = Bm
+
+U32
+BmPREVIOUS(sv)
+ B::BM sv
+
+U8
+BmRARE(sv)
+ B::BM sv
+
MODULE = B PACKAGE = B::GV PREFIX = Gv
void
MG_TYPE = PERL_MAGIC_bm\\(B\\)
MG_LEN = 256
MG_PTR = $ADDR "(?:\\\\\d){256}"
- RARE = \d+
- PREVIOUS = 1
+ RARE = \d+ # $] < 5.019002
+ PREVIOUS = 1 # $] < 5.019002
USEFUL = 100
');
MG_TYPE = PERL_MAGIC_bm\\(B\\)
MG_LEN = 256
MG_PTR = $ADDR "(?:\\\\\d){256}"
- RARE = \d+
- PREVIOUS = 1
+ RARE = \d+ # $] < 5.019002
+ PREVIOUS = 1 # $] < 5.019002
USEFUL = 100
');
MG_TYPE = PERL_MAGIC_bm\\(B\\)
MG_LEN = 256
MG_PTR = $ADDR "(?:\\\\\d){256}"
- RARE = \d+
- PREVIOUS = \d+
+ RARE = \d+ # $] < 5.019002
+ PREVIOUS = \d+ # $] < 5.019002
USEFUL = 100
';
U32 xlow;
U32 xhigh;
} xpad_cop_seq; /* used by pad.c for cop_sequence */
- struct {
- I32 xbm_useful;
- U8 xbm_rare; /* rarest character in string */
- } xbm_s; /* fields from PVBM */
+ I32 xbm_useful;
};
union _xivu {
#endif
#if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
-# define BmRARE(sv) \
- (*({ SV *const _bmrare = MUTABLE_SV(sv); \
- assert(SvTYPE(_bmrare) == SVt_PVMG); \
- assert(SvVALID(_bmrare)); \
- &(((XPVMG*) SvANY(_bmrare))->xnv_u.xbm_s.xbm_rare); \
- }))
# define BmUSEFUL(sv) \
(*({ SV *const _bmuseful = MUTABLE_SV(sv); \
assert(SvTYPE(_bmuseful) == SVt_PVMG); \
assert(SvVALID(_bmuseful)); \
assert(!SvIOK(_bmuseful)); \
- &(((XPVMG*) SvANY(_bmuseful))->xnv_u.xbm_s.xbm_useful); \
- }))
-# define BmPREVIOUS(sv) \
- (*({ SV *const _bmprevious = MUTABLE_SV(sv); \
- assert(SvTYPE(_bmprevious) == SVt_PVMG); \
- assert(SvVALID(_bmprevious)); \
- &(((XPVMG*) SvANY(_bmprevious))->xiv_u.xivu_uv); \
+ &(((XPVMG*) SvANY(_bmuseful))->xnv_u.xbm_useful); \
}))
#else
-# define BmRARE(sv) ((XPVMG*) SvANY(sv))->xnv_u.xbm_s.xbm_rare
-# define BmUSEFUL(sv) ((XPVMG*) SvANY(sv))->xnv_u.xbm_s.xbm_useful
-# define BmPREVIOUS(sv) ((XPVMG*) SvANY(sv))->xiv_u.xivu_uv
+# define BmUSEFUL(sv) ((XPVMG*) SvANY(sv))->xnv_u.xbm_useful
#endif
+#ifndef PERL_CORE
+# define BmRARE(sv) 0
+# define BmPREVIOUS(sv) 0
+#endif
+
#define FmLINES(sv) ((XPVIV*) SvANY(sv))->xiv_iv
#define LvTYPE(sv) ((XPVLV*) SvANY(sv))->xlv_type
frequency = PL_freq[s[i]];
}
}
- BmRARE(sv) = s[rarest];
- BmPREVIOUS(sv) = rarest;
BmUSEFUL(sv) = 100; /* Initial value */
if (flags & FBMcf_TAIL)
SvTAIL_on(sv);
DEBUG_r(PerlIO_printf(Perl_debug_log, "rarest char %c at %"UVuf"\n",
- BmRARE(sv), BmPREVIOUS(sv)));
+ s[rarest], rarest));
}
/* If SvTAIL(littlestr), it has a fake '\n' at end. */