summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2002-05-02 05:22:02 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2002-05-02 13:06:18 +0000
commit51a5ed28a579e633464fefb93efa351ff19a6d18 (patch)
tree37c6e74fbc9b2598284073f0266da647df870904 /malloc.c
parent9d80fab7f434775d75d5309e90003e2376bbdb5f (diff)
downloadperl-51a5ed28a579e633464fefb93efa351ff19a6d18.tar.gz
Re: [ID 20020425.009] perlio & -Dm dumps core
Message-Id: <200205020322.g423M2p19726@crypt.compulink.co.uk> p4raw-id: //depot/perl@16342
Diffstat (limited to 'malloc.c')
-rw-r--r--malloc.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/malloc.c b/malloc.c
index 450b6a257a..aafe41d709 100644
--- a/malloc.c
+++ b/malloc.c
@@ -356,9 +356,16 @@
#ifdef DEBUGGING
# undef DEBUG_m
-# define DEBUG_m(a) \
+# define DEBUG_m(a) \
STMT_START { \
- if (PERL_GET_INTERP) { dTHX; if (DEBUG_m_TEST) { a; } } \
+ if (PERL_GET_INTERP) { \
+ dTHX; \
+ if (DEBUG_m_TEST) { \
+ PL_debug &= ~DEBUG_m_FLAG; \
+ a; \
+ PL_debug |= DEBUG_m_FLAG; \
+ } \
+ } \
} STMT_END
#endif
@@ -1103,11 +1110,6 @@ Perl_malloc(register size_t nbytes)
return (NULL);
}
- DEBUG_m(PerlIO_printf(Perl_debug_log,
- "0x%"UVxf": (%05lu) malloc %ld bytes\n",
- PTR2UV(p), (unsigned long)(PL_an++),
- (long)size));
-
/* remove from linked list */
#if defined(RCHECK)
if ((PTR2UV(p)) & (MEM_ALIGNBYTES - 1)) {
@@ -1128,6 +1130,11 @@ Perl_malloc(register size_t nbytes)
MALLOC_UNLOCK;
+ DEBUG_m(PerlIO_printf(Perl_debug_log,
+ "0x%"UVxf": (%05lu) malloc %ld bytes\n",
+ PTR2UV(p), (unsigned long)(PL_an++),
+ (long)size));
+
#ifdef IGNORE_SMALL_BAD_FREE
if (bucket >= FIRST_BUCKET_WITH_CHECK)
#endif