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.

--
I think it worked on the Wiley Coyote model of project management - if
at any point you looked down and realised what you were doing was
impossible then you'd instantly fail.
  -- Simon Wistow



Reply via email to