#ifndef CvISXSUB
# define CvISXSUB(cv) (CvXSUB(cv) ? TRUE : FALSE)
#endif
+#ifndef SvRV_const
+# define SvRV_const(rv) SvRV(rv)
+#endif
#ifdef _MSC_VER
/* "structured exception" handling is a Microsoft extension to C and C++.
U8 **leaf_p;
U8 *leaf;
unsigned int i;
- void **tv_p = (void **) (st->tracking);
+ void **tv_p;
+
- assert(st);
- if (NULL == p) return FALSE;
+ if (NULL == p || NULL == st) return FALSE;
+ tv_p = (void **) (st->tracking);
TRY_TO_CATCH_SEGV {
const char c = *(const char *)p;
}
bits -= 8;
} while (bits > LEAF_BITS + BYTE_BITS);
/* bits now 16 always */
+#if !defined(MULTIPLICITY) || PERL_VERSION > 8 || (PERL_VERSION == 8 && PERL_SUBVERSION > 8)
+ /* 5.8.8 and early have an assert() macro that uses Perl_croak, hence needs
+ a my_perl under multiplicity */
assert(bits == 16);
+#endif
leaf_p = (U8 **)tv_p;
i = (unsigned int)((cooked_p >> bits) & 0xFF);
if (!leaf_p[i])
much has been allocated */
case SVt_PV: TAG;
total_size += sizeof(XPV);
-#if (PERL_VERSION < 11)
- total_size += SvROK(thing) ? thing_size(aTHX_ SvRV(thing), st) : SvLEN(thing);
-#else
- total_size += SvLEN(thing);
-#endif
+ total_size += SvROK(thing) ? thing_size(aTHX_ SvRV_const(thing), st) : SvLEN(thing);
TAG;break;
/* A string with an integer part? */
case SVt_PVIV: TAG;
total_size += sizeof(XPVIV);
-#if (PERL_VERSION < 11)
- total_size += SvROK(thing) ? thing_size(aTHX_ SvRV(thing), st) : SvLEN(thing);
-#else
- total_size += SvLEN(thing);
-#endif
+ total_size += SvROK(thing) ? thing_size(aTHX_ SvRV_const(thing), st) : SvLEN(thing);
if(SvOOK(thing)) {
total_size += SvIVX(thing);
}
/* A scalar/string/reference with a float part? */
case SVt_PVNV: TAG;
total_size += sizeof(XPVNV);
-#if (PERL_VERSION < 11)
- total_size += SvROK(thing) ? thing_size(aTHX_ SvRV(thing), st) : SvLEN(thing);
-#else
- total_size += SvLEN(thing);
-#endif
+ total_size += SvROK(thing) ? thing_size(aTHX_ SvRV_const(thing), st) : SvLEN(thing);
TAG;break;
case SVt_PVMG: TAG;
total_size += sizeof(XPVMG);
-#if (PERL_VERSION < 11)
- total_size += SvROK(thing) ? thing_size(aTHX_ SvRV(thing), st) : SvLEN(thing);
-#else
- total_size += SvLEN(thing);
-#endif
+ total_size += SvROK(thing) ? thing_size(aTHX_ SvRV_const(thing), st) : SvLEN(thing);
total_size += magic_size(thing, st);
TAG;break;
#if PERL_VERSION <= 8
case SVt_PVBM: TAG;
total_size += sizeof(XPVBM);
-#if (PERL_VERSION < 11)
- total_size += SvROK(thing) ? thing_size(aTHX_ SvRV(thing), st) : SvLEN(thing);
-#else
- total_size += SvLEN(thing);
-#endif
+ total_size += SvROK(thing) ? thing_size(aTHX_ SvRV_const(thing), st) : SvLEN(thing);
total_size += magic_size(thing, st);
TAG;break;
#endif
case SVt_PVLV: TAG;
total_size += sizeof(XPVLV);
-#if (PERL_VERSION < 11)
- total_size += SvROK(thing) ? thing_size(aTHX_ SvRV(thing), st) : SvLEN(thing);
-#else
- total_size += SvLEN(thing);
-#endif
+ total_size += SvROK(thing) ? thing_size(aTHX_ SvRV_const(thing), st) : SvLEN(thing);
total_size += magic_size(thing, st);
TAG;break;
/* How much space is dedicated to the array? Not counting the
pending_array = newAV();
- /* We cannot push HV/AV directly, only the RV. So deref it
- later (see below for "*** dereference later") and adjust here for
- the miscalculation.
+ /* If they passed us a reference then dereference it.
This is the only way we can check the sizes of arrays and hashes. */
if (SvROK(thing)) {
- RETVAL -= thing_size(aTHX_ thing, NULL);
+ thing = SvRV(thing);
}
/* Put it on the pending array */
av_push(pending_array, SvRV(thing));
}
TAG;break;
-
- /* this is the "*** dereference later" part - see above */
#if (PERL_VERSION < 11)
case SVt_RV: TAG;
#else