in reply to Calling a C function using malloc() in a XS
malloc() gets redefined by macro to one of the official memory allocation functions: Newx(), Newxc(), or Newxz(), but free() doesn't get redefined to Safefree().
The solution is to use the official apis, not the crt functions.
Or, if your memory allocations are never passed back to your perl code, #undef malloc at the top of your IC code.
|
|---|