diff options
author | Father Chrysostomos <sprout@cpan.org> | 2016-08-07 15:53:40 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2016-08-07 17:36:50 -0700 |
commit | 33a4312b882ab5f5396974a8fe8f5235559c2d82 (patch) | |
tree | a946e1c01c926eb1ef790c3551203f08f5cce2b9 /inline.h | |
parent | 6a29646efd2b54a6feec66ee83d2852418bfb748 (diff) | |
download | perl-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.h | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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 * |