[Jifty-commit] r5382 - Runops-Hook/trunk

Jifty commits jifty-commit at lists.jifty.org
Wed May 7 09:15:52 EDT 2008


Author: nothingmuch
Date: Wed May  7 09:15:52 2008
New Revision: 5382

Modified:
   Runops-Hook/trunk/Hook.xs

Log:
XPUSHREF macro

Modified: Runops-Hook/trunk/Hook.xs
==============================================================================
--- Runops-Hook/trunk/Hook.xs	(original)
+++ Runops-Hook/trunk/Hook.xs	Wed May  7 09:15:52 2008
@@ -4,6 +4,8 @@
 #include "embed.h"
 #include "XSUB.h"
 
+#define XPUSHREF(x) XPUSHs(sv_2mortal(newRV(x)))
+
 bool (*Runops_Hook_hook)(pTHX);
 
 static HV *Runops_Hook_op_counters;
@@ -159,15 +161,15 @@
 		case ARITY_LIST:
 			/* repeat stack from the op's mark to SP just before we started pushing */
 			for (list_mark = PL_stack_base + *(PL_markstack_ptr-1); list_mark < orig_sp;) {
-				XPUSHs(sv_2mortal(newRV(*++list_mark)));
+				XPUSHREF(*++list_mark);
 			}
 
 			break;
 
 		case ARITY_BINARY:
-			XPUSHs(sv_2mortal(newRV(*(orig_sp - 1))));
+			XPUSHREF(*(orig_sp-1));
 		case ARITY_UNARY:
-			XPUSHs(sv_2mortal(newRV(*orig_sp)));
+			XPUSHREF(*orig_sp);
 			break;
 
 		case ARITY_NULL:


More information about the Jifty-commit mailing list