=for apidoc Am|SV*|SvREFCNT_inc|SV* sv
Increments the reference count of the given SV.
+All of the following SvREFCNT_inc* macros are optimized versions of
+SvREFCNT_inc, and can be replaced with SvREFCNT_inc.
+
+=for apidoc Am|SV*|SvREFCNT_inc_NN|SV* sv
+Same as SvREFCNT_inc, but can only be used if you know I<sv>
+is not NULL. Since we don't have to check the NULLness, it's faster
+and smaller.
+
+=for apidoc Am|SV*|SvREFCNT_inc_void|SV* sv
+Same as SvREFCNT_inc, but can only be used if you don't need the
+return value. The macro doesn't need to return a meaningful value.
+
+=for apidoc Am|SV*|SvREFCNT_inc_void_NN|SV* sv
+Same as SvREFCNT_inc, but can only be used if you don't need the return
+value, and you know that I<sv> is not NULL. The macro doesn't need
+to return a meaningful value, or check for NULLness, so it's smaller
+and faster.
+
+=for apidoc Am|SV*|SvREFCNT_inc_simple|SV* sv
+Same as SvREFCNT_inc, but can only be used with simple variables, not
+expressions or pointer dereferences. Since we don't have to store a
+temporary value, it's faster.
+
+=for apidoc Am|SV*|SvREFCNT_inc_simple_NN|SV* sv
+Same as SvREFCNT_inc_simple, but can only be used if you know I<sv>
+is not NULL. Since we don't have to check the NULLness, it's faster
+and smaller.
+
+=for apidoc Am|SV*|SvREFCNT_inc_simple_void|SV* sv
+Same as SvREFCNT_inc_simple, but can only be used if you don't need the
+return value. The macro doesn't need to return a meaningful value.
+
+=for apidoc Am|SV*|SvREFCNT_inc|SV* sv
+Increments the reference count of the given SV.
+
=for apidoc Am|void|SvREFCNT_dec|SV* sv
Decrements the reference count of the given SV.
(SvREFCNT(_sv))++; \
_sv; \
})
+# define SvREFCNT_inc_simple(sv) \
+ ({ \
+ if (sv) \
+ (SvREFCNT(sv))++; \
+ (SV *)(sv); \
+ })
+# define SvREFCNT_inc_NN(sv) \
+ ({ \
+ SV * const _sv = (SV*)(sv); \
+ SvREFCNT(_sv)++; \
+ _sv; \
+ })
+# define SvREFCNT_inc_void(sv) \
+ ({ \
+ SV * const _sv = (SV*)(sv); \
+ if (_sv) \
+ (void)(SvREFCNT(_sv)++); \
+ })
#else
# define SvREFCNT_inc(sv) \
- ((PL_Sv=(SV*)(sv)) ? ((++(SvREFCNT(PL_Sv))),(PL_Sv)) : NULL)
+ ((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL)
+# define SvREFCNT_inc_simple(sv) \
+ ((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL)
+# define SvREFCNT_inc_NN(sv) \
+ (PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv)
+# define SvREFCNT_inc_void(sv) \
+ (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0)
#endif
+/* These guys don't need the curly blocks */
+#define SvREFCNT_inc_simple_void(sv) if (sv) (SvREFCNT(sv)++);
+#define SvREFCNT_inc_simple_NN(sv) (++(SvREFCNT(sv)),(SV*)(sv))
+#define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
+#define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
+
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(PERL_GCC_PEDANTIC)
# define SvREFCNT_dec(sv) \
({ \
UV xivu_uv;
void * xivu_p1;
I32 xivu_i32;
+ HEK * xivu_namehek;
} xiv_u;
};
UV xivu_uv;
void * xivu_p1;
I32 xivu_i32;
+ HEK * xivu_namehek;
} xiv_u;
} xpviv_allocated;
#endif
IV xuvu_iv;
UV xuvu_uv; /* unsigned value or pv offset */
void * xuvu_p1;
+ HEK * xivu_namehek;
} xuv_u;
};
UV xivu_uv;
void * xivu_p1;
I32 xivu_i32;
+ HEK * xivu_namehek;
} xiv_u;
};
UV xivu_uv;
void * xivu_p1;
I32 xivu_i32;
+ HEK * xivu_namehek;
} xiv_u;
union {
MAGIC* xmg_magic; /* linked list of magicalness */
UV xivu_uv;
void * xivu_p1;
I32 xivu_i32;
+ HEK * xivu_namehek; /* GvNAME */
} xiv_u;
union {
MAGIC* xmg_magic; /* linked list of magicalness */
} xmg_u;
HV* xmg_stash; /* class package */
- /* a full glob fits into this */
- char* xgv_name;
- STRLEN xgv_namelen;
- U8 xgv_flags;
-
STRLEN xlv_targoff;
STRLEN xlv_targlen;
SV* xlv_targ;
NV xnv_nv;
HV * xgv_stash; /* The stash of this GV */
} xnv_u;
- STRLEN xpv_cur; /* length of svu_pv as a C string */
- STRLEN xpv_len; /* allocated size */
+ STRLEN xpv_cur; /* xgv_flags */
+ STRLEN xpv_len; /* 0 */
union {
- IV xivu_iv; /* integer value or pv offset */
+ IV xivu_iv;
UV xivu_uv;
void * xivu_p1;
I32 xivu_i32;
+ HEK * xivu_namehek; /* GvNAME */
} xiv_u;
union {
MAGIC* xmg_magic; /* linked list of magicalness */
} xmg_u;
HV* xmg_stash; /* class package */
- char* xgv_name;
- STRLEN xgv_namelen;
- U8 xgv_flags;
};
struct xpvbm {
UV xivu_uv;
void * xivu_p1;
I32 xivu_i32;
+ HEK * xivu_namehek;
} xiv_u;
union {
MAGIC* xmg_magic; /* linked list of magicalness */
UV xivu_uv;
void * xivu_p1;
I32 xivu_i32;
+ HEK * xivu_namehek;
} xiv_u;
union {
MAGIC* xmg_magic; /* linked list of magicalness */
UV xivu_uv;
void * xivu_p1;
I32 xivu_i32;
+ HEK * xivu_namehek;
} xiv_u;
union {
MAGIC* xmg_magic; /* linked list of magicalness */
UV xivu_uv;
void * xivu_p1;
I32 xivu_i32;
+ HEK * xivu_namehek;
} xiv_u;
union {
MAGIC* xmg_magic; /* linked list of magicalness */