summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorJan Dubois <jand@activestate.com>2005-11-18 03:38:24 -0800
committerSteve Peters <steve@fisharerojo.org>2005-11-20 02:31:10 +0000
commite8dda941161b48515d0da4da6e5157084cbd1df0 (patch)
tree31944ab69501dec5d5500e326174b0797e20f630 /perl.h
parent891c2e08c4b0cd567c57c23427f594d70b2bced2 (diff)
downloadperl-e8dda941161b48515d0da4da6e5157084cbd1df0.tar.gz
Reworked PERL_TRACK_MEMPOOL patch
From: "Jan Dubois" <jand@ActiveState.com> Message-ID: <003601c5ec77$a45eb260$2217a8c0@candy> p4raw-id: //depot/perl@26177
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h16
1 files changed, 13 insertions, 3 deletions
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