This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta: typo
[perl5.git] / dump.c
diff --git a/dump.c b/dump.c
index a25740b..93094a4 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -30,7 +30,7 @@
 
 static const char* const svtypenames[SVt_LAST] = {
     "NULL",
-    "BIND",
+    "DUMMY",
     "IV",
     "NV",
     "PV",
@@ -50,7 +50,7 @@ static const char* const svtypenames[SVt_LAST] = {
 
 static const char* const svshorttypenames[SVt_LAST] = {
     "UNDEF",
-    "BIND",
+    "DUMMY",
     "IV",
     "NV",
     "PV",
@@ -1803,7 +1803,30 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
        }
        PerlIO_putc(file, '\n');
        Perl_dump_indent(aTHX_ level, file, "  KEYS = %"IVdf"\n", (IV)HvUSEDKEYS(sv));
-       Perl_dump_indent(aTHX_ level, file, "  FILL = %"IVdf"\n", (IV)HvFILL(sv));
+        {
+            STRLEN count = 0;
+            HE **ents = HvARRAY(sv);
+
+            if (ents) {
+                HE *const *const last = ents + HvMAX(sv);
+                count = last + 1 - ents;
+                
+                do {
+                    if (!*ents)
+                        --count;
+                } while (++ents <= last);
+            }
+
+            if (SvOOK(sv)) {
+                struct xpvhv_aux *const aux = HvAUX(sv);
+                Perl_dump_indent(aTHX_ level, file, "  FILL = %"UVuf
+                                 " (cached = %"UVuf")\n",
+                                 (UV)count, (UV)aux->xhv_fill_lazy);
+            } else {
+                Perl_dump_indent(aTHX_ level, file, "  FILL = %"UVuf"\n",
+                                 (UV)count);
+            }
+        }
        Perl_dump_indent(aTHX_ level, file, "  MAX = %"IVdf"\n", (IV)HvMAX(sv));
         if (SvOOK(sv)) {
            Perl_dump_indent(aTHX_ level, file, "  RITER = %"IVdf"\n", (IV)HvRITER_get(sv));
@@ -2771,8 +2794,8 @@ Perl_sv_xmlpeek(pTHX_ SV *sv)
     case SVt_PVGV:
        sv_catpv(t, " GV=\"");
        break;
-    case SVt_BIND:
-       sv_catpv(t, " BIND=\"");
+    case SVt_DUMMY:
+       sv_catpv(t, " DUMMY=\"");
        break;
     case SVt_REGEXP:
        sv_catpv(t, " REGEXP=\"");