summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-12-01 01:00:09 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-12-01 01:00:09 +0000
commit7766f1371a6d2b58d0f46fbe6a60785860a39c1e (patch)
tree700a30f3a9c7640a0c123dc9608fc998df8ecfb4 /hv.c
parent363b4d598618baccb2a68ae886e2608f45cd3cb5 (diff)
downloadperl-7766f1371a6d2b58d0f46fbe6a60785860a39c1e.tar.gz
more complete pseudo-fork() support for Windows
p4raw-id: //depot/perl@4602
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/hv.c b/hv.c
index e38c785f05..c591cbf2a8 100644
--- a/hv.c
+++ b/hv.c
@@ -81,8 +81,16 @@ Perl_he_dup(pTHX_ HE *e, bool shared)
if (!e)
return Nullhe;
+ /* look for it in the table first */
+ ret = (HE*)ptr_table_fetch(PL_ptr_table, e);
+ if (ret)
+ return ret;
+
+ /* create anew and remember what it is */
ret = new_he();
- HeNEXT(ret) = (HE*)NULL;
+ ptr_table_store(PL_ptr_table, e, ret);
+
+ HeNEXT(ret) = he_dup(HeNEXT(e),shared);
if (HeKLEN(e) == HEf_SVKEY)
HeKEY_sv(ret) = SvREFCNT_inc(sv_dup(HeKEY_sv(e)));
else if (shared)