develooper Front page | perl.perl5.porters | Postings from January 2016

Assistance needed with XS code

Thread Next
John Peacock
January 1, 2016 15:06
Assistance needed with XS code
Message ID:
I'm working my way through the backlog of RT tickets for in 
preparation to release 0.9913 with the Lyon Compromise.

I've run into something I can't figure out:

I cannot figure out how to create the version object in XS in such a way 
that it is an RV of an HV.  The way I am currently doing it is to create 
an RV then upgrade that to an HV,

     hv = newSVrv(rv, "version"); /* create an SV and upgrade the RV */
     (void)sv_upgrade(hv, SVt_PVHV); /* needs to be an HV type */

but this apparently doesn't DTRT for the object's stash.  I tried to use 
newHV directly, then upgrade that to an RV, but that throws cores every 

If someone can suggest how I can do this properly, I'm all ears.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About