summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/Devel/Peek/Peek.xs12
-rw-r--r--malloc.c4
2 files changed, 9 insertions, 7 deletions
diff --git a/ext/Devel/Peek/Peek.xs b/ext/Devel/Peek/Peek.xs
index cf47c3cddd..0351cc2864 100644
--- a/ext/Devel/Peek/Peek.xs
+++ b/ext/Devel/Peek/Peek.xs
@@ -127,16 +127,14 @@ DeadCode(pTHX)
#endif /* !PURIFY */
}
-#if (defined(PERL_DEBUGGING_MSTATS) || defined(DEBUGGING_MSTATS)) \
- && (defined(MYMALLOC) && !defined(PLAIN_MALLOC))
+#if defined(MYMALLOC)
# define mstat(str) dump_mstats(str)
#else
# define mstat(str) \
- PerlIO_printf(Perl_debug_log, "%s: perl not compiled with DEBUGGING_MSTATS\n",str);
+ PerlIO_printf(Perl_debug_log, "%s: perl not compiled with MYMALLOC\n",str);
#endif
-#if (defined(PERL_DEBUGGING_MSTATS) || defined(DEBUGGING_MSTATS)) \
- && (defined(MYMALLOC) && !defined(PLAIN_MALLOC))
+#if defined(MYMALLOC)
/* Very coarse overestimate, 2-per-power-of-2, one more to determine NBUCKETS. */
# define _NBUCKETS (2*8*IVSIZE+1)
@@ -293,7 +291,7 @@ mstats2hash(SV *sv, SV *rv, int level)
croak("Wrong size for a value with a mstats buffer");
_mstats_to_hv((HV *)SvRV(rv), (struct mstats_buffer*)SvPVX(sv), level);
}
-#else /* !( defined(PERL_DEBUGGING_MSTATS) || defined(DEBUGGING_MSTATS) \ ) */
+#else /* defined(MYMALLOC) */
static void
fill_mstats(SV *sv, int level)
{
@@ -311,7 +309,7 @@ mstats2hash(SV *sv, SV *rv, int level)
{
croak("Cannot report mstats without Perl malloc");
}
-#endif /* defined(PERL_DEBUGGING_MSTATS) || defined(DEBUGGING_MSTATS)... */
+#endif /* defined(MYMALLOC) */
#define _CvGV(cv) \
(SvROK(cv) && (SvTYPE(SvRV(cv))==SVt_PVCV) \
diff --git a/malloc.c b/malloc.c
index 682eeb6278..a8d4554653 100644
--- a/malloc.c
+++ b/malloc.c
@@ -2450,6 +2450,8 @@ Perl_get_mstats(pTHX_ perl_mstats_t *buf, int buflen, int level)
buf->bucket_available_size[i] = BUCKET_SIZE_REAL(i);
}
}
+#else /* defined DEBUGGING_MSTATS */
+ PerlIO_printf(Perl_error_log, "perl not compiled with DEBUGGING_MSTATS\n");
#endif /* defined DEBUGGING_MSTATS */
return 0; /* XXX unused */
}
@@ -2523,6 +2525,8 @@ Perl_dump_mstats(pTHX_ char *s)
buffer.total_sbrk, buffer.sbrks, buffer.sbrk_good,
buffer.sbrk_slack, buffer.start_slack,
buffer.total_chain, buffer.sbrked_remains);
+#else /* DEBUGGING_MSTATS */
+ PerlIO_printf(Perl_error_log, "%s: perl not compiled with DEBUGGING_MSTATS\n",s);
#endif /* DEBUGGING_MSTATS */
}