summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-04-02 18:23:58 +0000
committerNicholas Clark <nick@ccl4.org>2008-04-02 18:23:58 +0000
commite82be400b1a05af41d9d7f8509dfe352c4f1c75f (patch)
tree1153f74a2df1742f376d4bd3a7db459cb0f7e5e9 /perl.h
parent84335ee93339f99a0959258e640fa57e9f0ba6ab (diff)
downloadperl-e82be400b1a05af41d9d7f8509dfe352c4f1c75f.tar.gz
Fix bug in change 33379 - if we're using malloc_size() as well as being
careful to work with PERL_TRACK_MEMPOOL, we also have to be careful to work *without* it. p4raw-id: //depot/perl@33629
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/perl.h b/perl.h
index b69baca874..4cd9a2b586 100644
--- a/perl.h
+++ b/perl.h
@@ -4081,17 +4081,25 @@ struct perl_memory_debug_header {
#ifdef MYMALLOC
# define Perl_safesysmalloc_size(where) Perl_malloced_size(where)
#else
-# ifdef HAS_MALLOC_SIZE
+# ifdef HAS_MALLOC_SIZE
+# ifdef PERL_TRACK_MEMPOOL
# define Perl_safesysmalloc_size(where) \
(malloc_size(((char *)(where)) - sTHX) - sTHX)
-# endif
-# ifdef HAS_MALLOC_GOOD_SIZE
+# else
+# define Perl_safesysmalloc_size(where) malloc_size(where)
+# endif
+# endif
+# ifdef HAS_MALLOC_GOOD_SIZE
+# ifdef PERL_TRACK_MEMPOOL
# define Perl_malloc_good_size(how_much) \
(malloc_good_size((how_much) + sTHX) - sTHX)
-# else
+# else
+# define Perl_malloc_good_size(how_much) malloc_good_size(how_much)
+# endif
+# else
/* Having this as the identity operation makes some code simpler. */
# define Perl_malloc_good_size(how_much) (how_much)
-# endif
+# endif
#endif
typedef int (CPERLscope(*runops_proc_t)) (pTHX);