diff --git a/hv.c b/hv.c index 011c34cd9ed7..980fb0cf218f 100644 --- a/hv.c +++ b/hv.c @@ -352,20 +352,20 @@ C has another extra parameter, C, a precomputed hash of the key string, or zero if it has not been precomputed. This parameter is omitted from C, as it is computed automatically at compile time. -If is NULL, NULL is returned and no action is taken. +If C is NULL, NULL is returned and no action is taken. If C is NULL, it is treated as being C; otherwise the caller is responsible for suitably incrementing the reference count of C before the call, and decrementing it if the function returned C. Effectively a successful C takes ownership of one reference to C. This is usually what you want; a newly created SV has a reference count of one, so -if all your code does is create SVs then store them in a hash, C +if all your code does is create SVs and store them in a hash, C will own the only reference to the new SV, and your code doesn't need to do anything further to tidy up. C is not implemented as a call to L>, and does not create a temporary SV for the key, so if your key data is not already in SV -form then use C in preference to C. +form, then use C in preference to C. See L for more information on how to use this function on tied hashes. @@ -373,7 +373,7 @@ information on how to use this function on tied hashes. =for apidoc hv_store_ent Stores C in a hash. The hash key is specified as C. The C -parameter is the precomputed hash value; if it is zero then Perl will +parameter is the precomputed hash value; if it is zero, then Perl will compute it. The return value is the new hash entry so created. It will be C if the operation failed or if the value did not need to be actually stored within the hash (as in the case of tied hashes). Otherwise the @@ -383,15 +383,15 @@ incrementing the reference count of C before the call, and decrementing it if the function returned NULL. Effectively a successful C takes ownership of one reference to C. This is usually what you want; a newly created SV has a reference count of one, so -if all your code does is create SVs then store them in a hash, C +if all your code does is create SVs and store them in a hash, C will own the only reference to the new SV, and your code doesn't need to do anything further to tidy up. Note that C only reads the C; unlike C it does not take ownership of it, so maintaining the correct reference count on C is entirely the caller's responsibility. The reason -it does not take ownership, is that C is not used after this function +it does not take ownership is that C is not used after this function returns, and so can be freed immediately. C is not implemented as a call to C, and does not create a temporary -SV for the key, so if your key data is not already in SV form then use +SV for the key, so if your key data is not already in SV form, then use C in preference to C. See L for more