[decnum-dynpmcs] r180 committed - Let's leak some memory to get our tests passing again. Aren't order of...

1 view
Skip to first unread message

codesite...@google.com

unread,
Aug 29, 2009, 5:03:06 AM8/29/09
to decnum-...@googlegroups.com
Revision: 180
Author: arbelo
Date: Fri Aug 28 18:08:00 2009
Log: Let's leak some memory to get our tests passing again. Aren't order of
destruction bugs fun?


http://code.google.com/p/decnum-dynpmcs/source/detail?r=180

Modified:
/trunk/src/pmc/decintcontext.pmc
/trunk/src/pmc/decnumcontext.pmc

=======================================
--- /trunk/src/pmc/decintcontext.pmc Wed Aug 26 17:36:58 2009
+++ /trunk/src/pmc/decintcontext.pmc Fri Aug 28 18:08:00 2009
@@ -53,9 +53,11 @@
attr->exceptions = DEC_Errors;
attr->ctx = mem_allocate_typed(decContext);
set_context_defaults(attr->ctx);
-
- PObj_active_destroy_SET(SELF);
- }
+ }
+/* PObj_active_destroy_SET(SELF);
+ * We are leaking memory with this, but the alternative is a segfault.
+ * This PMC only gets collected on interpreter destruction anyway.
+ */
}

METHOD restore_defaults() {
=======================================
--- /trunk/src/pmc/decnumcontext.pmc Wed Aug 26 17:39:45 2009
+++ /trunk/src/pmc/decnumcontext.pmc Fri Aug 28 18:08:00 2009
@@ -54,14 +54,17 @@
attr->exceptions = DEC_Errors;
attr->ctx = mem_allocate_typed(decContext);
set_context_defaults(attr->ctx);
-
- PObj_active_destroy_SET(SELF);
- }
+ }
+/* PObj_active_destroy_SET(SELF);
+ * We are leaking memory with this, but the alternative is a segfault.
+ * This PMC only gets collected on interpreter destruction anyway.
+ */
}

VTABLE void destroy() {
mem_sys_free(PARROT_DECNUMCONTEXT(SELF)->ctx);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}

VTABLE void freeze(visit_info *info) {

Reply all
Reply to author
Forward
0 new messages