add specific thank yous to Ack section for a couple things I can't see fitting into...
[p5sagit/p5-mst-13.2.git] / util.c
diff --git a/util.c b/util.c
index 15dd162..666f99f 100644 (file)
--- a/util.c
+++ b/util.c
@@ -70,12 +70,16 @@ S_write_no_mem(pTHX)
     NORETURN_FUNCTION_END;
 }
 
+#if defined (DEBUGGING) || defined(PERL_IMPLICIT_SYS) || defined (PERL_TRACK_MEMPOOL)
+#  define ALWAYS_NEED_THX
+#endif
+
 /* paranoid version of system's malloc() */
 
 Malloc_t
 Perl_safesysmalloc(MEM_SIZE size)
 {
-#ifdef DEBUGGING
+#ifdef ALWAYS_NEED_THX
     dTHX;
 #endif
     Malloc_t ptr;
@@ -121,7 +125,7 @@ Perl_safesysmalloc(MEM_SIZE size)
        return ptr;
 }
     else {
-#ifndef DEBUGGING
+#ifndef ALWAYS_NEED_THX
        dTHX;
 #endif
        if (PL_nomemok)
@@ -138,7 +142,7 @@ Perl_safesysmalloc(MEM_SIZE size)
 Malloc_t
 Perl_safesysrealloc(Malloc_t where,MEM_SIZE size)
 {
-#ifdef DEBUGGING
+#ifdef ALWAYS_NEED_THX
     dTHX;
 #endif
     Malloc_t ptr;
@@ -223,7 +227,7 @@ Perl_safesysrealloc(Malloc_t where,MEM_SIZE size)
        return ptr;
     }
     else {
-#ifndef DEBUGGING
+#ifndef ALWAYS_NEED_THX
        dTHX;
 #endif
        if (PL_nomemok)
@@ -240,7 +244,7 @@ Perl_safesysrealloc(Malloc_t where,MEM_SIZE size)
 Free_t
 Perl_safesysfree(Malloc_t where)
 {
-#if defined(DEBUGGING) && (defined(PERL_IMPLICIT_SYS) || defined(PERL_TRACK_MEMPOOL))
+#ifdef ALWAYS_NEED_THX
     dTHX;
 #else
     dVAR;
@@ -282,7 +286,7 @@ Perl_safesysfree(Malloc_t where)
 Malloc_t
 Perl_safesyscalloc(MEM_SIZE count, MEM_SIZE size)
 {
-#ifdef DEBUGGING
+#ifdef ALWAYS_NEED_THX
     dTHX;
 #endif
     Malloc_t ptr;
@@ -347,7 +351,7 @@ Perl_safesyscalloc(MEM_SIZE count, MEM_SIZE size)
        return ptr;
     }
     else {
-#ifndef DEBUGGING
+#ifndef ALWAYS_NEED_THX
        dTHX;
 #endif
        if (PL_nomemok)