Skip to content

Commit c2217cd

Browse files
committed
improve api entries for hv_clear() and hv_undef()
The =apidoc entries for hv_clear() and hv_undef() were a bit spartan. Make it clearer what the two functions actually do, and the relationship between them.
1 parent 00a1a64 commit c2217cd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

hv.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,8 @@ Perl_hv_delayfree_ent(pTHX_ HV *hv, register HE *entry)
15191519
/*
15201520
=for apidoc hv_clear
15211521
1522-
Clears a hash, making it empty.
1522+
Frees the all the elements of a hash, leaving it empty.
1523+
The XS equivalent of %hash = (). See also L</hv_undef>.
15231524
15241525
=cut
15251526
*/
@@ -1725,7 +1726,11 @@ Perl_hfree_next_entry(pTHX_ HV *hv, STRLEN *indexp)
17251726
/*
17261727
=for apidoc hv_undef
17271728
1728-
Undefines the hash.
1729+
Undefines the hash. The XS equivalent of undef(%hash).
1730+
1731+
As well as freeing all the elements of the hash (like hv_clear()), this
1732+
also frees any auxiliary data and storage associated with the hash.
1733+
See also L</hv_clear>.
17291734
17301735
=cut
17311736
*/

0 commit comments

Comments
 (0)