[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl5-porters
Subject:    [PATCH] Some more SvREFCNT_inc updates
From:       andy () petdance ! com (Andy Lester)
Date:       2006-04-30 18:24:14
Message-ID: 20060430182414.GA18094 () petdance ! com
[Download RAW message or body]

Here's some more optimizations of SvREFCNT_inc calls.

xoxo,
Andy

-- 
Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance

["refcnt.patch" (text/plain)]

Index: pp_ctl.c
===================================================================
--- pp_ctl.c	(revision 605)
+++ pp_ctl.c	(working copy)
@@ -2418,7 +2418,7 @@
 
 		CvDEPTH(cv)++;
 		if (CvDEPTH(cv) < 2)
-		    SvREFCNT_inc_void_NN(cv);
+		    SvREFCNT_inc_simple_void_NN(cv);
 		else {
 		    if (CvDEPTH(cv) == 100 && ckWARN(WARN_RECURSION))
 			sub_crush_depth(cv);
@@ -3190,7 +3190,7 @@
 			if (SvROK(arg) && (SvTYPE(SvRV(arg)) <= SVt_PVLV)
 			    && !isGV_with_GP(SvRV(arg))) {
 			    filter_cache = SvRV(arg);
-			    SvREFCNT_inc_void_NN(filter_cache);
+			    SvREFCNT_inc_simple_void_NN(filter_cache);
 
 			    if (i < count) {
 				arg = SP[i++];
@@ -3222,7 +3222,7 @@
 
 			if (SvROK(arg) && SvTYPE(SvRV(arg)) == SVt_PVCV) {
 			    filter_sub = arg;
-			    SvREFCNT_inc_void_NN(filter_sub);
+			    SvREFCNT_inc_simple_void_NN(filter_sub);
 
 			    if (i < count) {
 				filter_state = SP[i];
Index: cop.h
===================================================================
--- cop.h	(revision 605)
+++ cop.h	(working copy)
@@ -270,8 +270,8 @@
 	cx->blk_sub.hasargs = hasargs;					\
 	cx->blk_sub.retop = NULL;					\
 	if (!CvDEPTH(cv)) {						\
-	    SvREFCNT_inc_void(cv);					\
-	    SvREFCNT_inc_void(cv);					\
+	    SvREFCNT_inc_simple_void_NN(cv);				\
+	    SvREFCNT_inc_simple_void_NN(cv);				\
 	    SAVEFREESV(cv);						\
 	}
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic