- Turns out that OP_TRANS is a basic op, not a loop op. This
is a bug in versions of perl 5.8.x before 5.8.7. Work around
it.
+
+0.64 Mon Dec 19 18:46:00 2005
+ - Patch to make Devel::Size compile on bleadperl (Courtesy of
+ Nick Clark)
+ - Fix up the PVIV string size calcs (Courtesy of Andrew Shirrayev)
\ No newline at end of file
pointer as the length. Perl then uses the four (or eight, on
64-bit machines) bytes of the address as the string we're using as
the key */
-IV check_new(HV *tracking_hash, void *thing) {
+IV check_new(HV *tracking_hash, const void *thing) {
if (NULL == thing) {
return FALSE;
}
return total_size;
}
+#if PERL_VERSION > 9 || (PERL_VERSION == 9 && PERL_SUBVERSION > 2)
+# define NEW_HEAD_LAYOUT
+#endif
+
UV thing_size(SV *orig_thing, HV *tracking_hash) {
SV *thing = orig_thing;
UV total_size = sizeof(SV);
/* Just a plain integer. This will be differently sized depending
on whether purify's been compiled in */
case SVt_IV:
-#ifdef PURIFY
+#ifndef NEW_HEAD_LAYOUT
+# ifdef PURIFY
total_size += sizeof(sizeof(XPVIV));
-#else
+# else
total_size += sizeof(IV);
+# endif
#endif
break;
/* Is it a float? Like the int, it depends on purify */
break;
/* Is it a reference? */
case SVt_RV:
+#ifndef NEW_HEAD_LAYOUT
total_size += sizeof(XRV);
+#endif
break;
/* How about a plain string? In which case we need to add in how
much has been allocated */
case SVt_PVIV:
total_size += sizeof(XPVIV);
total_size += SvLEN(thing);
+ total_size += SvIVX(thing);
break;
/* A string with a float part? */
case SVt_PVNV:
case SVt_PVIO:
total_size += sizeof(XPVIO);
total_size += magic_size(thing, tracking_hash);
- if (check_new(tracking_hash, ((XPVIO *) SvANY(thing))->xpv_pv)) {
+ if (check_new(tracking_hash, (SvPVX(thing)))) {
total_size += ((XPVIO *) SvANY(thing))->xpv_cur;
}
/* Some embedded char pointers */