in reply to Re: Help me improve my XS.
in thread Help me improve my XS.

I didn't explain properly about the lack of leak.

There would be no leak even if you did use mortals. There's already a ENTER+SAVETMPS and FREETMPS+LEAVE around the call to the XS function.

You'd use those or G_DISCARD if you want to free the mortals created by your callback sooner (e.g. after every call to call_sv instead of when strIter returns).