in reply to Re: Re: Perl XS: garbage-collecting my malloc'd buffer
in thread Perl XS: garbage-collecting my malloc'd buffer

Yep, that's still the case. SvGROW checks xpv_len, which'll be some bizarre value if the SV's just an IV or NV. Undef might well give it fits too, at least so reads the 5.8.0 sources.
  • Comment on Re: Re: Re: Perl XS: garbage-collecting my malloc'd buffer

Replies are listed 'Best First'.
Re^4: Perl XS: garbage-collecting my malloc'd buffer (sv_grow?)
by tye (Sage) on Mar 03, 2003 at 18:14 UTC

    Wouldn't calling sv_grow() directly fix that?

                    - tye
      Yep, it would. SvGROW tries to be clever, and fails, unfortunately. (And the docs discourage using sv_grow directly, just to compound the potential problems)