From: Nicholas Clark Date: Fri, 19 May 2006 21:44:14 +0000 (+0000) Subject: Correct Perl_refcounted_he_chain_2hv() and its caller - it doesn't X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ec2a1de722601129850327b38324ac227c58147a;p=p5sagit%2Fp5-mst-13.2.git Correct Perl_refcounted_he_chain_2hv() and its caller - it doesn't store a reference to the value, so don't pass it in a new SV. p4raw-id: //depot/perl@28245 --- diff --git a/hv.c b/hv.c index 8630adf..b6bc29e 100644 --- a/hv.c +++ b/hv.c @@ -2674,10 +2674,9 @@ Perl_refcounted_he_chain_2hv(pTHX_ const struct refcounted_he *chain) /* =for apidoc refcounted_he_new -Creates a new C. Assumes ownership of one reference -to I. As S is copied into a shared hash key, all references remain -the property of the caller. The C is returned with a -reference count of 1. +Creates a new C. As S is copied, and value is +stored in a compact form, all references remain the property of the caller. +The C is returned with a reference count of 1. =cut */ diff --git a/mg.c b/mg.c index 7e7372d..c8c935a 100644 --- a/mg.c +++ b/mg.c @@ -2877,7 +2877,7 @@ Perl_magic_sethint(pTHX_ SV *sv, MAGIC *mg) PL_hints |= HINT_LOCALIZE_HH; PL_compiling.cop_hints = Perl_refcounted_he_new(aTHX_ PL_compiling.cop_hints, - (SV *)mg->mg_ptr, newSVsv(sv)); + (SV *)mg->mg_ptr, sv); return 0; } diff --git a/pod/perlintern.pod b/pod/perlintern.pod index 7fc7114..b79d54e 100644 --- a/pod/perlintern.pod +++ b/pod/perlintern.pod @@ -500,10 +500,9 @@ Found in file hv.c =item refcounted_he_new X -Creates a new C. Assumes ownership of one reference -to I. As S is copied into a shared hash key, all references remain -the property of the caller. The C is returned with a -reference count of 1. +Creates a new C. As S is copied, and value is +stored in a compact form, all references remain the property of the caller. +The C is returned with a reference count of 1. struct refcounted_he * refcounted_he_new(struct refcounted_he *const parent, SV *const key, SV *const value)