This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add $Config('scriptdir'} on VMS
[perl5.git] / malloc.c
index 0f668cd..6a2ff15 100644 (file)
--- a/malloc.c
+++ b/malloc.c
 #  ifndef pTHX
 #     define pTHX              void
 #     define pTHX_
-#     define dTHX              extern int Perl___notused
+#     ifdef HASATTRIBUTE
+#        define dTHX           extern int Perl___notused PERL_UNUSED_DECL
+#     else
+#        define dTHX            extern int Perl___notused
+#     endif
 #     define WITH_THX(s)       s
 #  endif
 #  ifndef PERL_GET_INTERP
 #  undef DEBUG_m
 #  define DEBUG_m(a)  \
     STMT_START {                                                       \
-       if (PERL_GET_INTERP) { dTHX; if (PL_debug & 128) { a; } }       \
+       if (PERL_GET_INTERP) { dTHX; if (DEBUG_m_TEST) { a; } } \
     } STMT_END
 #endif
 
@@ -1041,7 +1045,9 @@ Perl_malloc(register size_t nbytes)
            POW2_OPTIMIZE_ADJUST(nbytes);
            nbytes += M_OVERHEAD;
            nbytes = (nbytes + 3) &~ 3; 
+#if defined(PACK_MALLOC) && !defined(SMALL_BUCKET_VIA_TABLE)
          do_shifts:
+#endif
            shiftr = (nbytes - 1) >> START_SHIFT;
            bucket = START_SHIFTS_BUCKET;
            /* apart from this loop, this is O(1) */
@@ -1096,7 +1102,7 @@ Perl_malloc(register size_t nbytes)
 
        DEBUG_m(PerlIO_printf(Perl_debug_log,
                              "0x%"UVxf": (%05lu) malloc %ld bytes\n",
-                             PTR2UV(p+1), (unsigned long)(PL_an++),
+                             PTR2UV(p), (unsigned long)(PL_an++),
                              (long)size));
 
        /* remove from linked list */