X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=malloc.c;h=6a2ff15547534a81d82cd839b6d14845cac46b50;hb=8669ce85400697f979231096bfa64a8216391e5e;hp=5d9652e869c86e70e0680ee313bba4b40fadc009;hpb=0b4157167f29504603edb868ef958105102ba24d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/malloc.c b/malloc.c index 5d9652e..6a2ff15 100644 --- a/malloc.c +++ b/malloc.c @@ -304,7 +304,11 @@ # 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 @@ -351,7 +355,7 @@ # 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 @@ -886,16 +890,12 @@ static union overhead *nextf[NBUCKETS]; #endif #ifdef USE_PERL_SBRK -#define sbrk(a) Perl_sbrk(a) +# define sbrk(a) Perl_sbrk(a) Malloc_t Perl_sbrk (int size); -#else -#ifdef DONT_DECLARE_STD -#ifdef I_UNISTD -#include -#endif #else +# ifndef HAS_SBRK_PROTO /* usually takes care of this */ extern Malloc_t sbrk(int); -#endif +# endif #endif #ifdef DEBUGGING_MSTATS @@ -1045,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) */ @@ -1100,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 */