]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - Magic.xs
Allocate context hash iterators as soon as they are created
[perl/modules/Variable-Magic.git] / Magic.xs
index cbd65dc742c18b6b67d24b009907b80aca014286..ce1c4b339c29167983002ce03ef39347bb80bc03 100644 (file)
--- a/Magic.xs
+++ b/Magic.xs
@@ -794,6 +794,7 @@ BOOT:
  HV *stash;
  MY_CXT_INIT;
  MY_CXT.wizz = newHV();
+ hv_iterinit(MY_CXT.wizz); /* Allocate iterator */
  MY_CXT.count = 0;
  stash = gv_stashpv(__PACKAGE__, 1);
  newCONSTSUB(stash, "SIG_MIN",   newSVuv(SIG_MIN));
@@ -826,6 +827,7 @@ CODE:
   dMY_CXT;
   count = MY_CXT.count;
   hv = newHV();
+  hv_iterinit(hv); /* Allocate iterator */
   hv_iterinit(MY_CXT.wizz);
   while (key = hv_iternext(MY_CXT.wizz)) {
    STRLEN len;