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.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy