in reply to Re^2: Wrapping a C shared library with Perl and XS
in thread Wrapping a C shared library with Perl and XS
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:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Wrapping a C shared library with Perl and XS
by stevieb (Canon) on Mar 31, 2017 at 23:23 UTC | |
by Anonymous Monk on Apr 06, 2017 at 17:38 UTC | |
by stevieb (Canon) on Apr 08, 2017 at 03:34 UTC | |
by Anonymous Monk on May 08, 2017 at 12:37 UTC | |
by stevieb (Canon) on May 08, 2017 at 14:42 UTC |