This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.h: Move bits around to allow for future growth
authorKarl Williamson <public@khwilliamson.com>
Sun, 1 Aug 2010 04:21:54 +0000 (22:21 -0600)
committerRafael Garcia-Suarez <rgs@consttype.org>
Wed, 11 Aug 2010 08:23:35 +0000 (10:23 +0200)
This creates an unallocated space at the shared/unshared boundary of the
data with regexp.h.  This allows any future bits that may be needed to
go into either, without affecting binary compatibility.  I chose a
number of spare bits larger than I thought we would ever need

op.h

diff --git a/op.h b/op.h
index 0102e36..4241f02 100644 (file)
--- a/op.h
+++ b/op.h
@@ -360,7 +360,9 @@ struct pmop {
 #define PM_SETRE(o,r)   ((o)->op_pmregexp = (r))
 #endif
 
 #define PM_SETRE(o,r)   ((o)->op_pmregexp = (r))
 #endif
 
-#define PMf_BASE_SHIFT _RXf_PMf_SHIFT_NEXT
+/* Leave some space, so future bit allocations can go either in the shared or
+ * unshared area without affecting binary compatibility */
+#define PMf_BASE_SHIFT (_RXf_PMf_SHIFT_NEXT+8)
 
 /* taint $1 etc. if target tainted */
 #define PMf_RETAINT    (1<<(PMf_BASE_SHIFT+0))
 
 /* taint $1 etc. if target tainted */
 #define PMf_RETAINT    (1<<(PMf_BASE_SHIFT+0))