summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-08-02 00:35:11 -0400
committerGurusamy Sarathy <gsar@cpan.org>1998-08-02 09:28:32 +0000
commit42ac124e1121d9d0c888a584bc0d509345698865 (patch)
tree86848b432a99ed6a5e30bf2f02c785d04f266507 /malloc.c
parentf264d47263c7375271aa7881cc3559ec63be6afa (diff)
downloadperl-42ac124e1121d9d0c888a584bc0d509345698865.tar.gz
Better debugging output from malloc.c
Message-Id: <199808020835.EAA09367@monk.mps.ohio-state.edu> p4raw-id: //depot/maint-5.005/perl@1713
Diffstat (limited to 'malloc.c')
-rw-r--r--malloc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/malloc.c b/malloc.c
index bba7741351..73c4039d80 100644
--- a/malloc.c
+++ b/malloc.c
@@ -1377,6 +1377,10 @@ realloc(void *mp, size_t nbytes)
#endif
res = cp;
MUTEX_UNLOCK(&PL_malloc_mutex);
+ DEBUG_m(PerlIO_printf(Perl_debug_log,
+ "0x%lx: (%05lu) realloc %ld bytes inplace\n",
+ (unsigned long)res,(unsigned long)(PL_an++),
+ (long)size));
} else if (incr == 1 && (cp - M_OVERHEAD == last_op)
&& (onb > (1 << LOG_OF_MIN_ARENA))) {
MEM_SIZE require, newarena = nbytes, pow;
@@ -1405,6 +1409,10 @@ realloc(void *mp, size_t nbytes)
} else {
hard_way:
MUTEX_UNLOCK(&PL_malloc_mutex);
+ DEBUG_m(PerlIO_printf(Perl_debug_log,
+ "0x%lx: (%05lu) realloc %ld bytes the hard way\n",
+ (unsigned long)cp,(unsigned long)(PL_an++),
+ (long)size));
if ((res = (char*)malloc(nbytes)) == NULL)
return (NULL);
if (cp != res) /* common optimization */
@@ -1412,13 +1420,6 @@ realloc(void *mp, size_t nbytes)
if (was_alloced)
free(cp);
}
-
- DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%lu: (%05lu) rfree\n",
- (unsigned long)res,(unsigned long)(PL_an++)));
- DEBUG_m(PerlIO_printf(Perl_debug_log,
- "0x%lx: (%05lu) realloc %ld bytes\n",
- (unsigned long)res,(unsigned long)(PL_an++),
- (long)size));
return ((Malloc_t)res);
}