summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2013-03-24 11:48:12 +0100
committerYves Orton <demerphq@gmail.com>2013-03-24 11:50:18 +0100
commite1a7ec8d453649a65aea34af90c3042a5137191e (patch)
treec865e78cabc2b4ec7436679e51e55609c6d397cb /hv.h
parentff20b672a2557d27fcb80d597224fa0c24e43f73 (diff)
downloadperl-e1a7ec8d453649a65aea34af90c3042a5137191e.tar.gz
improve how Devel::Peek::Dump handles iterator information
* If the hash is not OOK omit any iterator status information instead of showing -1/NULL * If the hash is OOK then add the RAND value from the iterator and if the LASTRAND is not the same show it too * Tweak tests to test the above.
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/hv.h b/hv.h
index e6b9bb8288..61bc5bd54b 100644
--- a/hv.h
+++ b/hv.h
@@ -226,6 +226,9 @@ C<SV*>.
#define HvEITER_set(hv,e) Perl_hv_eiter_set(aTHX_ MUTABLE_HV(hv), e)
#define HvRITER_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_riter : -1)
#define HvEITER_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_eiter : NULL)
+#define HvRAND_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_rand : 0)
+#define HvLASTRAND_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_last_rand : 0)
+
#define HvNAME(hv) HvNAME_get(hv)
#define HvNAMELEN(hv) HvNAMELEN_get(hv)
#define HvENAME(hv) HvENAME_get(hv)