in reply to Re: Inline C : dereferencing array of hash references returned from function
in thread Inline C : dereferencing array of hash references returned from function

Hello Ikegami, Indeed, the 4th argument should be a SV*, naïve try from me, but yep I'm an inline - xs beginner. The code works just by changing :
..... hv_store(rh, "donkey", 6, "kong", 0); .....
to :
..... hv_store(rh, "donkey", 6, newSVpv("kong", 0), 0); .....
The key-value pairs are now printed out as one expects. As pointed out by you it's maybe better indeed to use the documented newRV_noinc function. Curious to sort out the differences between the two. Many thanks for your time, Cheers, Bruno

Replies are listed 'Best First'.
Re^3: Inline C : dereferencing array of hash references returned from function
by ikegami (Patriarch) on Feb 16, 2011 at 16:31 UTC

    Curious to sort out the differences between the two.

    Not much...

    #define newRV_inc(sv) newRV(sv)

    "newRV_inc is the official function name to use now." according to a comment.