void (perls_free)( void*p ) = &free; #undef free // free() should now refer to the crt free() and use perls_free() for XS