This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Fix leak
[perl5.git] / op.h
diff --git a/op.h b/op.h
index 4a544d9..fc21f03 100644 (file)
--- a/op.h
+++ b/op.h
@@ -24,7 +24,7 @@
  *                      !op_slabbed.
  *     op_savefree     on savestack via SAVEFREEOP
  *     op_folded       Result/remainder of a constant fold operation.
- *     op_moresib      this op is is not the last sibling
+ *     op_moresib      this op is not the last sibling
  *     op_spare        One spare bit
  *     op_flags        Flags common to all operations.  See OPf_* below.
  *     op_private      Flags peculiar to a particular operation (BUT,
@@ -181,7 +181,7 @@ Deprecated.  Use C<GIMME_V> instead.
 
 
 /* things that can be elements of op_aux */
-typedef union  {
+typedef union {
     PADOFFSET pad_offset;
     SV        *sv;
     IV        iv;
@@ -372,6 +372,10 @@ struct pmop {
 #define PMf_IS_QR      (1U<<(PMf_BASE_SHIFT+15))
 #define PMf_USE_RE_EVAL        (1U<<(PMf_BASE_SHIFT+16)) /* use re'eval' in scope */
 
+/* Means that this is a subpattern being compiled while processing a \p{}
+ * wildcard.  This isn't called from op.c, but it is passed as a pm flag. */
+#define PMf_WILDCARD    (1U<<(PMf_BASE_SHIFT+17))
+
 /* See comments at the beginning of these defines about adding bits.  The
  * highest bit position should be used, so that if PMf_BASE_SHIFT gets
  * increased, the #error below will be triggered so that you will be reminded
@@ -699,8 +703,9 @@ struct opslot {
 struct opslab {
     OPSLAB *   opslab_next;            /* next slab */
     OPSLAB *   opslab_head;            /* first slab in chain */
-    OP *       opslab_freed;           /* chain of freed ops (head only)*/
+    OP **      opslab_freed;           /* array of sized chains of freed ops (head only)*/
     size_t     opslab_refcnt;          /* number of ops (head slab only) */
+    U16         opslab_freed_size;      /* allocated size of opslab_freed */
     U16                opslab_size;            /* size of slab in pointers,
                                            including header */
     U16         opslab_free_space;     /* space available in this slab
@@ -1125,7 +1130,7 @@ C<sib> is non-null. For a higher-level interface, see C<L</op_sibling_splice>>.
 
 /* stuff for OP_ARGCHECK */
 
-struct  op_argcheck_aux {
+struct op_argcheck_aux {
     UV   params;     /* number of positional parameters */
     UV   opt_params; /* number of optional positional parameters */
     char slurpy;     /* presence of slurpy: may be '\0', '@' or '%' */