store a reference to the value, so don't pass it in a new SV.
p4raw-id: //depot/perl@28245
/*
=for apidoc refcounted_he_new
-Creates a new C<struct refcounted_he>. Assumes ownership of one reference
-to I<value>. As S<key> is copied into a shared hash key, all references remain
-the property of the caller. The C<struct refcounted_he> is returned with a
-reference count of 1.
+Creates a new C<struct refcounted_he>. As S<key> is copied, and value is
+stored in a compact form, all references remain the property of the caller.
+The C<struct refcounted_he> is returned with a reference count of 1.
=cut
*/
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;
}
=item refcounted_he_new
X<refcounted_he_new>
-Creates a new C<struct refcounted_he>. Assumes ownership of one reference
-to I<value>. As S<key> is copied into a shared hash key, all references remain
-the property of the caller. The C<struct refcounted_he> is returned with a
-reference count of 1.
+Creates a new C<struct refcounted_he>. As S<key> is copied, and value is
+stored in a compact form, all references remain the property of the caller.
+The C<struct refcounted_he> 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)