[svn:parrot] r40799 - in trunk/src: gc pmc
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Tue Aug 25 23:13:57 UTC 2009
Author: whiteknight
Date: Tue Aug 25 23:13:54 2009
New Revision: 40799
URL: https://trac.parrot.org/parrot/changeset/40799
Log:
[gc] plug a big memory leak that was caused by the auto_attrs changes. The attributes structures weren't being freed in the GC. However, with the fix we were running into an order-of-destruction problem with the scheduler, so I commented out a line in the Scheduler PMC to avoid that
Modified:
trunk/src/gc/mark_sweep.c
trunk/src/pmc/scheduler.pmc
Modified: trunk/src/gc/mark_sweep.c
==============================================================================
--- trunk/src/gc/mark_sweep.c Tue Aug 25 22:49:11 2009 (r40798)
+++ trunk/src/gc/mark_sweep.c Tue Aug 25 23:13:54 2009 (r40799)
@@ -781,6 +781,19 @@
if (PObj_active_destroy_TEST(p))
VTABLE_destroy(interp, pmc);
+ if (PMC_data(pmc) && pmc->vtable->attr_size) {
+#if GC_USE_FIXED_SIZE_ALLOCATOR
+ Parrot_gc_free_pmc_attributes(interp, pmc, pmc->vtable->attr_size);
+#else
+ mem_sys_free(PMC_data(pmc));
+ PMC_data(pmc) = NULL;
+#endif
+ }
+ else {
+ PMC_data(pmc) = NULL;
+ }
+
+
#ifndef NDEBUG
pmc->vtable = (VTABLE *)0xdeadbeef;
Modified: trunk/src/pmc/scheduler.pmc
==============================================================================
--- trunk/src/pmc/scheduler.pmc Tue Aug 25 22:49:11 2009 (r40798)
+++ trunk/src/pmc/scheduler.pmc Tue Aug 25 23:13:54 2009 (r40799)
@@ -246,7 +246,9 @@
*/
VTABLE void destroy() {
Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF);
- MUTEX_DESTROY(core_struct->msg_lock);
+ /* XXX this line is causing an order-of-destruction error because the scheduler
+ is being freed before it's tasks. Commenting this out till we get a real fix */
+ /* MUTEX_DESTROY(core_struct->msg_lock); */
}
More information about the parrot-commits
mailing list