in reply to Re^4: XS: exposing C++ library constant as package variable ( sv_setiv , SvIV_set )
in thread XS: exposing C++ library constant as package variable

It was crashing because you forgot to upgrade the scalar to one that has an IV slot before trying to change the IV slot. sv_setiv works because it performs the upgrade.

  • Comment on Re^5: XS: exposing C++ library constant as package variable ( sv_setiv , SvIV_set )
  • Download Code

Replies are listed 'Best First'.
Re^6: XS: exposing C++ library constant as package variable ( sv_setiv , SvIV_set )
by wisnij (Novice) on Oct 14, 2015 at 16:19 UTC

    Ah, now that is useful information; thanks. The Perl XS documentation was not very helpful in making it clear what the implicit preconditions for each function are, I'm afraid.