This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
INSTALL - document how to build a perl without taint support
[perl5.git] / pad.h
diff --git a/pad.h b/pad.h
index c857929..8f339ae 100644 (file)
--- a/pad.h
+++ b/pad.h
@@ -94,8 +94,13 @@ struct padname_with_str {
  * own substructure, stored in ->xpadn_fieldinfo.
  */
 struct padname_fieldinfo {
+    U32        refcount;
     PADOFFSET  fieldix;    /* index of this field within ObjectFIELDS() array */
     HV        *fieldstash; /* original class package which added this field */
+    OP        *defop;      /* optree fragment for defaulting expression */
+    SV        *paramname;  /* name of the :param to look for in constructor */
+    int        def_if_undef : 1; /* default op uses //= */
+    int        def_if_false : 1; /* default op uses ||= */
 };
 
 
@@ -326,6 +331,7 @@ Restore the old pad saved into the local variable C<opad> by C<PAD_SAVE_LOCAL()>
 #define PadnamelistMAX(pnl)            (pnl)->xpadnl_fill
 #define PadnamelistMAXNAMED(pnl)       (pnl)->xpadnl_max_named
 #define PadnamelistREFCNT(pnl)         (pnl)->xpadnl_refcnt
+#define PadnamelistREFCNT_inc(pnl)      Perl_padnamelist_refcnt_inc(pnl)
 #define PadnamelistREFCNT_dec(pnl)     Perl_padnamelist_free(aTHX_ pnl)
 
 #define PadARRAY(pad)          AvARRAY(pad)
@@ -383,6 +389,11 @@ Restore the old pad saved into the local variable C<opad> by C<PAD_SAVE_LOCAL()>
 #  define PADNAMEt_OUR          PADNAMEf_OUR
 #endif
 
+#ifdef USE_ITHREADS
+#  define padnamelist_dup_inc(pnl,param)  PadnamelistREFCNT_inc(padnamelist_dup(pnl,param))
+#  define padname_dup_inc(pn,param)       PadnameREFCNT_inc(padname_dup(pn,param))
+#endif
+
 #ifdef DEBUGGING
 #  define PAD_SV(po)      pad_sv(po)
 #  define PAD_SETSV(po,sv) pad_setsv(po,sv)