As the MADPROPs are referenced from the optree, which is itself shared,
MADPROPs can't use the default malloc(), which is per i-thread, lest a
child thread frees the optree, and bad things(tm) happen. (a "free to wrong
pool" panic if you're on Win32, or elsewhere if you've got DEBUGGING)
MADPROP *
Perl_newMADPROP(pTHX_ char key, char type, void* val, I32 vlen)
{
- MADPROP *mp;
- Newxz(mp, 1, MADPROP);
+ MADPROP *const mp = (MADPROP *) PerlMemShared_malloc(sizeof(MADPROP));
mp->mad_next = 0;
mp->mad_key = key;
mp->mad_vlen = vlen;
PerlIO_printf(PerlIO_stderr(), "Unrecognized mad\n");
break;
}
- Safefree(mp);
+ PerlMemShared_free(mp);
}
#endif