X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl.h;h=4cd9a2b58699186ab28ba09e3bb3a1aa907e3ce7;hb=bf8300decce77d53edc393ca2221fb591a778c59;hp=7ad31768f0d88b0f14532b15829ccfa9ca4ec6c1;hpb=d2c25739add64fa456c06f60e5029d44b4a14912;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perl.h b/perl.h index 7ad3176..4cd9a2b 100644 --- a/perl.h +++ b/perl.h @@ -4059,6 +4059,8 @@ struct perl_memory_debug_header { (MEM_ALIGNBYTES - sizeof(struct perl_memory_debug_header) \ %MEM_ALIGNBYTES) % MEM_ALIGNBYTES) +#else +# define sTHX 0 #endif #ifdef PERL_TRACK_MEMPOOL @@ -4071,6 +4073,34 @@ struct perl_memory_debug_header { # define INIT_TRACK_MEMPOOL(header, interp) #endif +#ifdef I_MALLOCMALLOC +/* Needed for malloc_size(), malloc_good_size() on some systems */ +# include +#endif + +#ifdef MYMALLOC +# define Perl_safesysmalloc_size(where) Perl_malloced_size(where) +#else +# ifdef HAS_MALLOC_SIZE +# ifdef PERL_TRACK_MEMPOOL +# define Perl_safesysmalloc_size(where) \ + (malloc_size(((char *)(where)) - sTHX) - sTHX) +# 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 +# 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 typedef int (CPERLscope(*runops_proc_t)) (pTHX); typedef void (CPERLscope(*share_proc_t)) (pTHX_ SV *sv); @@ -4632,7 +4662,7 @@ typedef regexp*(CPERLscope(*regdupe_t)) (pTHX_ const regexp* r, CLONE_PARAMS *pa typedef void (*DESTRUCTORFUNC_NOCONTEXT_t) (void*); typedef void (*DESTRUCTORFUNC_t) (pTHX_ void*); typedef void (*SVFUNC_t) (pTHX_ SV* const); -typedef I32 (*SVCOMPARE_t) (pTHX_ SV*, SV*); +typedef I32 (*SVCOMPARE_t) (pTHX_ SV* const, SV* const); typedef void (*XSINIT_t) (pTHX); typedef void (*ATEXIT_t) (pTHX_ void*); typedef void (*XSUBADDR_t) (pTHX_ CV *);