Steven N. Hirsch <[EMAIL PROTECTED]> writes: > >This, I think, is the crux of my problem. I suppose I could contrive to >always wrap the XS call in a do-nothing set of braces. However, I'm >curious as to whether a better approach would be to establish a new perl >calling context on entry: > > >xs_entry: > > dSP; > ENTER; SAVETMPS; // Add this > > ... do things here > FREETMPS; // And this > LEAVE; XSRETURN(0); // With the FREETMPS it is hard to return anything... > >leave XS code.. > >This should trigger garbage collection
Perl doesn't do garbage collection as such - things are freed when their REFCNT gets to zero. >before control leaves C. I'm not >sure whether the sequence and/or syntax is correct. Can anyone comment? > >Steve