in reply to Re: Perl XS - is this code required in DBD::Pg? (cruft)
in thread Perl XS - is this code required in DBD::Pg?

SvSETMAGIC( ST(2) );    /* Is this correct? */
should be
SvSETMAGIC( bufsv );

The idea is to call tied($buf)->STORE() or similar if applicable.

Replies are listed 'Best First'.
Re^3: Perl XS - is this code required in DBD::Pg? (cruft)
by tye (Sage) on Jul 21, 2010 at 19:01 UTC

    Thanks. I had meant to replace ST(2) with bufsv (as I did other places). In the mean time I had read the docs on SvSETMAGIC() which indicated that usage was correct.

    I'll update my original code block since you quote my original line above.

    - tye        

Re^3: Perl XS - is this code required in DBD::Pg? (cruft)
by mje (Curate) on Jul 21, 2010 at 19:06 UTC

    Thanks ikegami. I am no XS or Perl internals expert so I appreciate the advice. I'll amend the code and come back here if that is all right.