summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-04-11 20:14:34 +0100
committerNicholas Clark <nick@ccl4.org>2011-05-19 08:55:56 +0100
commitc111d5f1ab8852c556adefbb6b416fd22274677c (patch)
tree9e2bb3f919a4cc39b0bf4e9f350590170a8682be /op.c
parent37c6a70c7d35357916da21616c68e56c878a5bd2 (diff)
downloadperl-c111d5f1ab8852c556adefbb6b416fd22274677c.tar.gz
Allocate MADPROPs using PerlMemShared_malloc()
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)
Diffstat (limited to 'op.c')
-rw-r--r--op.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/op.c b/op.c
index e21b9a478f..5740aa6139 100644
--- a/op.c
+++ b/op.c
@@ -3139,8 +3139,7 @@ Perl_newMADsv(pTHX_ char key, SV* sv)
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;
@@ -3177,7 +3176,7 @@ Perl_mad_free(pTHX_ MADPROP* mp)
PerlIO_printf(PerlIO_stderr(), "Unrecognized mad\n");
break;
}
- Safefree(mp);
+ PerlMemShared_free(mp);
}
#endif