From e8dda941161b48515d0da4da6e5157084cbd1df0 Mon Sep 17 00:00:00 2001 From: Jan Dubois Date: Fri, 18 Nov 2005 03:38:24 -0800 Subject: Reworked PERL_TRACK_MEMPOOL patch From: "Jan Dubois" Message-ID: <003601c5ec77$a45eb260$2217a8c0@candy> p4raw-id: //depot/perl@26177 --- perl.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'perl.h') diff --git a/perl.h b/perl.h index 172f96bb36..39e4f6ee84 100644 --- a/perl.h +++ b/perl.h @@ -148,12 +148,14 @@ # ifndef MULTIPLICITY # define MULTIPLICITY # endif -# define pTHX register PerlInterpreter *my_perl PERL_UNUSED_DECL +# define tTHX PerlInterpreter* +# define sTHX (sizeof(tTHX) + (MEM_ALIGNBYTES - sizeof(tTHX)%MEM_ALIGNBYTES) % MEM_ALIGNBYTES) +# define pTHX register tTHX my_perl PERL_UNUSED_DECL # define aTHX my_perl # ifdef PERL_GLOBAL_STRUCT -# define dTHXa(a) dVAR; pTHX = (PerlInterpreter*)a +# define dTHXa(a) dVAR; pTHX = (tTHX)a # else -# define dTHXa(a) pTHX = (PerlInterpreter*)a +# define dTHXa(a) pTHX = (tTHX)a # endif # ifdef PERL_GLOBAL_STRUCT # define dTHX dVAR; pTHX = PERL_GET_THX @@ -171,6 +173,11 @@ # define pTHX_7 8 # define pTHX_8 9 # define pTHX_9 10 +# if defined(DEBUGGING) && !defined(PERL_TRACK_MEMPOOL) +# define PERL_TRACK_MEMPOOL +# endif +#else +# undef PERL_TRACK_MEMPOOL #endif #define STATIC static @@ -231,6 +238,9 @@ #define dNOOP extern int Perl___notused PERL_UNUSED_DECL #ifndef pTHX +/* Don't bother defining tTHX and sTHX; using them outside + * code guarded by PERL_IMPLICIT_CONTEXT is an error. + */ # define pTHX void # define pTHX_ # define aTHX -- cgit v1.2.1