http://www.perlmonks.org?node_id=928034


in reply to Re^2: XS: returning a 64-bit unsigned int?
in thread XS: returning a 64-bit unsigned int?

sv_setuv_mg(sv, uv); is actually what you want unless you follow the sv_setuv(sv, uv); with SvSETMAGIC(sv);.

Replies are listed 'Best First'.
Re^4: XS: returning a 64-bit unsigned int?
by BrowserUk (Patriarch) on Sep 27, 2011 at 07:31 UTC

    Are you sure? (And can you explain why magic is needed?)

    Because it seems to work just fine without any magic?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      If there's no set magic attached, SvSETMAGIC(sv) does nothing. If there is, SvSETMAGIC(sv) makes it work. Knowing you and having just seen how you plan to use this, I know you'll simply assume there's no magic attached to the scalar.