Perl_fbm_compile(pTHX_ SV *sv, U32 flags)
{
const register U8 *s;
- register U8 *table;
register U32 i;
STRLEN len;
I32 rarest = 0;
U32 frequency = 256;
if (flags & FBMcf_TAIL) {
- MAGIC *mg = SvUTF8(sv) && SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_utf8) : NULL;
+ MAGIC * const mg = SvUTF8(sv) && SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_utf8) : NULL;
sv_catpvn(sv, "\n", 1); /* Taken into account in fbm_instr() */
if (mg && mg->mg_len >= 0)
mg->mg_len++;
if (len > 2) {
const unsigned char *sb;
const U8 mlen = (len>255) ? 255 : (U8)len;
+ register U8 *table;
Sv_Grow(sv, len + 256 + FBM_TABLE_OFFSET);
table = (unsigned char*)(SvPVX_mutable(sv) + len + FBM_TABLE_OFFSET);
GV *gv;
CV *cv;
/* sv_2cv might call Perl_croak() */
- SV *olddiehook = PL_diehook;
+ SV * const olddiehook = PL_diehook;
assert(PL_diehook);
ENTER;
const char *message;
if (pat) {
- SV *msv = vmess(pat, args);
+ SV * const msv = vmess(pat, args);
if (PL_errors && SvCUR(PL_errors)) {
sv_catsv(PL_errors, msv);
message = SvPV_const(PL_errors, *msglen);
"%p: die: curstack = %p, mainstack = %p\n",
thr, PL_curstack, PL_mainstack));
- message = S_vdie_croak_common(aTHX_ pat, args, &msglen, &utf8);
+ message = vdie_croak_common(pat, args, &msglen, &utf8);
PL_restartop = die_where(message, msglen);
SvFLAGS(ERRSV) |= utf8;
#ifdef PERL_MEM_LOG
Malloc_t
-Perl_mem_log_alloc(const UV n, const UV typesize, const char *typename, Malloc_t newalloc, const char *filename, const int linenumber)
+Perl_mem_log_alloc(const UV n, const UV typesize, const char *typename, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname)
{
#ifdef PERL_MEM_LOG_STDERR
/* We can't use PerlIO_printf() for obvious reasons. */
char buf[1024];
sprintf(buf,
- "alloc: %s:%d: %"IVdf" %"UVuf" %s = %"IVdf": %p\n",
- filename, linenumber,
- n, typesize, typename, n * typesize, newalloc);
+ "alloc: %s:%d:%s: %"IVdf" %"UVuf" %s = %"IVdf": %"UVxf"\n",
+ filename, linenumber, funcname,
+ n, typesize, typename, n * typesize, PTR2UV(newalloc));
write(2, buf, strlen(buf));
#endif
return newalloc;
}
Malloc_t
-Perl_mem_log_realloc(const UV n, const UV typesize, const char *typename, Malloc_t oldalloc, Malloc_t newalloc, const char *filename, const int linenumber)
+Perl_mem_log_realloc(const UV n, const UV typesize, const char *typename, Malloc_t oldalloc, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname)
{
#ifdef PERL_MEM_LOG_STDERR
/* We can't use PerlIO_printf() for obvious reasons. */
char buf[1024];
sprintf(buf,
- "realloc: %s:%d: %"IVdf" %"UVuf" %s = %"IVdf": %p -> %p\n",
- filename, linenumber,
- n, typesize, typename, n * typesize, oldalloc, newalloc);
+ "realloc: %s:%d:%s: %"IVdf" %"UVuf" %s = %"IVdf": %"UVxf" -> %"UVxf"\n",
+ filename, linenumber, funcname,
+ n, typesize, typename, n * typesize, PTR2UV(oldalloc), PTR2UV(newalloc));
write(2, buf, strlen(buf));
#endif
return newalloc;
}
Malloc_t
-Perl_mem_log_free(Malloc_t oldalloc, const char *filename, const int linenumber)
+Perl_mem_log_free(Malloc_t oldalloc, const char *filename, const int linenumber, const char *funcname)
{
#ifdef PERL_MEM_LOG_STDERR
/* We can't use PerlIO_printf() for obvious reasons. */
char buf[1024];
- sprintf(buf, "free: %s:%d: %p\n", filename, linenumber, oldalloc);
+ sprintf(buf, "free: %s:%d:%s: %"UVxf"\n",
+ filename, linenumber, funcname, PTR2UV(oldalloc));
write(2, buf, strlen(buf));
#endif
return oldalloc;