in reply to Does hv_delete() decrement the reference count of the SV * it returns?

Yes. It is documented, you just have to RTFS ;-) If you take a quick glance at the source in hv.c you will see that Perl_hv_delete (hv_delete is a define in objXSUB.h) calls Perl_hv_free_ent which in turn calls SvREFCNT_dec

cheers

tachyon

Replies are listed 'Best First'.
Re^2: Does hv_delete() decrement the reference count of the SV * it returns?
by Anonymous Monk on Oct 14, 2004 at 03:14 UTC

    Thanks tachyon!

    Not to nitpick, but don't you think this is a little unacceptable? If this reference counting scheme is going to work, don't the docs have say which routines mess with their arguments refcounts and which don't?

    Is there anyway I could get this info added to perlapi and perlguts? I've found other inconsistencies and omissions in the Perl C documentation too.

      Perl 5 guts are inconsistent and perl's ref counting is somewhat sub optimal, this is part of the desire for a total overhaul. If you wanted to submit updates to the documentation you would send them as patches to p5p. Here are the patching guidelines Perlguts.pod is a real doc in the pod/ dir. Perlapi.pod is autogenerated by embed.pl. NB: embed.pl also autogenerates perlapi.c Read the header of perlapi.c to find the correct files to edit that eventually become perlapi.pod.

      cheers

      tachyon