Jerry D. Hedden [Mon, 20 Nov 2006 07:32:36 +0000 (23:32 -0800)]
From: "Jerry D. Hedden" <jdhedden@yahoo.com>
Message-ID: <696736.39963.qm@web30204.mail.mud.yahoo.com>
p4raw-id: //depot/perl@29329
STATIC void
S_cop_free(pTHX_ COP* cop)
{
- Safefree(cop->cop_label); /* FIXME: treaddead ??? */
+ if (cop->cop_label) {
+#ifdef PERL_TRACK_MEMPOOL
+ Malloc_t ptr = (Malloc_t)(cop->cop_label - sTHX);
+ struct perl_memory_debug_header *const header
+ = (struct perl_memory_debug_header *)ptr;
+ /* Only the thread that allocated us can free us. */
+ if (header->interpreter == aTHX)
+#endif
+ Safefree(cop->cop_label);
+ }
CopFILE_free(cop);
CopSTASH_free(cop);
if (! specialWARN(cop->cop_warnings))