in reply to Re: Re: XS returning undef?
in thread XS returning undef?
You cannot swap the actual SV that the SV* in @_ is pointing to, as that SV itself is owned by the caller. @_ contains just *aliases* to the original parameters. Changing the SV*'s in @_ doesn't do anything to the value of the original parameter; they just go away when your function returns. (And since the stack isn't refcounted, you will leak memory too). You can only change the *value* of the SV that is being passed to you.