Muppet <[EMAIL PROTECTED]> writes:
>On Sep 15, 2004, at 11:42 AM, Reinhard Pagitsch wrote:
>
>> If I populate an array with av_push will the SV* val a copy in the 
>> array or it is only a reference to it?
>
>av_make() copies the svs you give it, but none of the other av 
>functions do.  av_store() and av_push() both store in the av the actual 
>pointers you give to them, which means they basically own the svs.
>
>if in doubt, see Perl_av_store() in perl/av.c; near the end, the line 
>ary[key] = val is where the pointer passed as an arg is stored in the 
>internal data structure.  val's refcount is never touched.

Indeed, not only is SV not copied, but its REFCNT is not changed either.
So this is quite a low level interface which gives maximum flexibility 
but requires caller to do more.

Reply via email to