in reply to Re: XS/Inline::C concat *any* two SVs.
in thread XS/Inline::C concat *any* two SVs.

This still doesn't answer the question as to why foo2() receives as pre-existing scalar makes no changes to it and returns it to the caller, and suddenly we have an unreferenced scalar message.

Which scalar suddenly becomes mortal just by virtue of being passed into a subroutine and returned? As there is only one scalar involved in foo2(), it can only be SV *a, but that brings me back to the question of why?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^2: XS/Inline::C concat *any* two SVs.

Replies are listed 'Best First'.
Re^3: XS/Inline::C concat *any* two SVs.
by vkon (Curate) on May 28, 2006 at 22:18 UTC
    first of all, get rid of following concept:
    SV* test( SV *a, SV *b ) { if( SvREADONLY( a ) ) // Readonly? Take a copy. a = newSVpv( SvPVX( a ), 0 );
    What do you do here? Under some conditions you will creat new SV under other equivalent conditions it will not. What code below that should think of a - should it free it or not (in terms of refcounting - should it rely refcnt inc or not?)

    Hence your uncertainity on whether refcount it.