One of the approaches to freeing memory is to call free right after the last usage of a pointer (in our case it's the loop which calls inline_stack_push(sv_2mortal(newSViv(c_array[i])));) and set it to NULL afterwards.
Setting a pointer to NULL serves double purpose:
In reply to Re^3: Wrapping a C shared library with Perl and XS
by Anonymous Monk
in thread Wrapping a C shared library with Perl and XS
by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |