summaryrefslogtreecommitdiff
path: root/inline.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2016-08-07 15:53:40 -0700
committerFather Chrysostomos <sprout@cpan.org>2016-08-07 17:36:50 -0700
commit33a4312b882ab5f5396974a8fe8f5235559c2d82 (patch)
treea946e1c01c926eb1ef790c3551203f08f5cce2b9 /inline.h
parent6a29646efd2b54a6feec66ee83d2852418bfb748 (diff)
downloadperl-33a4312b882ab5f5396974a8fe8f5235559c2d82.tar.gz
Unify mark macros
Use static inline functions to avoid having different code paths for GCC and non-GCC. INCMARK is unused on CPAN and only used as a statement in core, so it can become a statement.
Diffstat (limited to 'inline.h')
-rw-r--r--inline.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/inline.h b/inline.h
index 14e9dbe4c2..4cc6a74e3b 100644
--- a/inline.h
+++ b/inline.h
@@ -125,6 +125,29 @@ PadnameIN_SCOPE(const PADNAME * const pn, const U32 seq)
}
#endif
+/* ------------------------------- pp.h ------------------------------- */
+
+PERL_STATIC_INLINE I32
+S_TOPMARK(pTHX)
+{
+ DEBUG_s(DEBUG_v(PerlIO_printf(Perl_debug_log,
+ "MARK top %p %"IVdf"\n",
+ PL_markstack_ptr,
+ (IV)*PL_markstack_ptr)));
+ return *PL_markstack_ptr;
+}
+
+PERL_STATIC_INLINE I32
+S_POPMARK(pTHX)
+{
+ DEBUG_s(DEBUG_v(PerlIO_printf(Perl_debug_log,
+ "MARK pop %p %"IVdf"\n",
+ (PL_markstack_ptr-1),
+ (IV)*(PL_markstack_ptr-1))));
+ assert((PL_markstack_ptr > PL_markstack) || !"MARK underflow");
+ return *PL_markstack_ptr--;
+}
+
/* ----------------------------- regexp.h ----------------------------- */
PERL_STATIC_INLINE struct regexp *