My questions aren't really XS questions.
The question about the var declaration is a C portability question.
Whether the arg is guaranteed to be an AV or not has nothing to do with XS. It relates to the argument of an internal function that's only called internally.
The question about sv_2mortal is an elementary XS question, and it is documented. ("They are made mortal so that once the values are copied by the calling program, the SV's that held the returned values can be deallocated. If they were not mortal, then they would continue to exist after the XSUB routine returned, but would not be accessible. This is a memory leak.") My question was more along the lines of "does that apply to operators as well"? Of course, the answer is yes.
Finally, the question about dTARGET is specific to functions that implement perl opcodes. (For XS, you'd add dXSTARG; to make it work.) I'll grant you that Perl's internals aren't fully documented.
|