develooper Front page | perl.perl5.porters | Postings from July 2001

[patch] faster PM_GETRE

Thread Next
From:
Doug MacEachern
Date:
July 12, 2001 10:12
Subject:
[patch] faster PM_GETRE
Message ID:
Pine.LNX.4.21.0107121011530.28844-100000@mako.covalent.net
since the PL_regex_pad entries are always SVIVs, it is save to grab
SvIVX directly, which will be faster than what SvIV expands to.

--- op.h        2001/07/12 06:35:45     1.1.1.14
+++ op.h        2001/07/12 16:46:25
@@ -250,7 +250,7 @@
 };
 
 #ifdef USE_ITHREADS
-#define PM_GETRE(o)     ((REGEXP*)SvIV(PL_regex_pad[(o)->op_pmoffset]))
+#define PM_GETRE(o)     ((REGEXP*)SvIVX(PL_regex_pad[(o)->op_pmoffset]))
 #define PM_SETRE(o,r)   (sv_setiv(PL_regex_pad[(o)->op_pmoffset], (IV)r))
 #else
 #define PM_GETRE(o)     ((o)->op_pmregexp)



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About