From: Chip Salzenberg Date: Fri, 15 Oct 2010 00:50:10 +0000 (-0700) Subject: Document that av_delete and hv_delete make their return values mortal. X-Git-Tag: accepted/trunk/20130322.191538~7377 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3025a2e42cd703f48878ec60605f8960d5732efb;p=platform%2Fupstream%2Fperl.git Document that av_delete and hv_delete make their return values mortal. --- diff --git a/av.c b/av.c index b061828..d6db6bf 100644 --- a/av.c +++ b/av.c @@ -791,11 +791,11 @@ Perl_av_fill(pTHX_ register AV *av, I32 fill) /* =for apidoc av_delete -Deletes the element indexed by C from the array. Returns the -deleted element. If C equals C, the element is freed -and null is returned. Perl equivalent: C -for the non-C version and a void-context C -for the C version. +Deletes the element indexed by C from the array, makes the element mortal, +and returns it. If C equals C, the element is freed and null +is returned. Perl equivalent: C for the +non-C version and a void-context C for the +C version. =cut */ diff --git a/hv.c b/hv.c index 5482306..591865f 100644 --- a/hv.c +++ b/hv.c @@ -879,17 +879,18 @@ Perl_hv_scalar(pTHX_ HV *hv) /* =for apidoc hv_delete -Deletes a key/value pair in the hash. The value SV is removed from the -hash and returned to the caller. The C is the length of the key. -The C value will normally be zero; if set to G_DISCARD then NULL -will be returned. +Deletes a key/value pair in the hash. The value's SV is removed from the +hash, made mortal, and returned to the caller. The C is the length of +the key. The C value will normally be zero; if set to G_DISCARD then +NULL will be returned. NULL will also be returned if the key is not found. =for apidoc hv_delete_ent -Deletes a key/value pair in the hash. The value SV is removed from the -hash and returned to the caller. The C value will normally be zero; -if set to G_DISCARD then NULL will be returned. C can be a valid -precomputed hash value, or 0 to ask for it to be computed. +Deletes a key/value pair in the hash. The value SV is removed from the hash, +made mortal, and returned to the caller. The C value will normally be +zero; if set to G_DISCARD then NULL will be returned. NULL will also be +returned if the key is not found. C can be a valid precomputed hash +value, or 0 to ask for it to be computed. =cut */