note
ikegami
<p>I filed a ticket and was told that this is documented in [doc://perlxs].
<hr>
<p>This is quite useful as it usually improves readability. While
this works fine for an <c>SV *</c>, it's unfortunately not as easy
to have <c>AV *</c> or <c>HV *</c> as a return value. You <i>should</i> be
able to write:
<c>
AV *
array()
CODE:
RETVAL = newAV();
/* do something with RETVAL */
OUTPUT:
RETVAL
</c>
<p>But due to an unfixable bug (fixing it would break lots of existing
CPAN modules) in the typemap file, the reference count of the <c>AV *</c>
is not properly decremented. Thus, the above XSUB would leak memory
whenever it is being called. The same problem exists for <c>HV *</c>.
924529
924776