+ *
+ * The complex typemaps here are to ensure that the argument stack is protected
+ * against stomping by amglue_newSV*64, which may invoke a significant amount
+ * of perl code. "SP += argvi; PUTBACK;" increments the global stack pointer
+ * to cover the arguments processed so far, while "SPAGAIN; SP -= argvi;"
+ * restores the local stack pointer. The latter must be done before the newest
+ * argument is added to the stack. This whole process is a hack around SWIG's
+ * habit of invoking (out) typemaps while building the stack, instead of doing
+ * so in advance.