[svn:parrot] r40365 - trunk/src/pmc
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Sat Aug 1 22:10:44 UTC 2009
Author: NotFound
Date: Sat Aug 1 22:10:42 2009
New Revision: 40365
URL: https://trac.parrot.org/parrot/changeset/40365
Log:
[cage] clean init and destroy on several pmc, TT #895
Modified:
trunk/src/pmc/fixedintegerarray.pmc
trunk/src/pmc/fixedpmcarray.pmc
trunk/src/pmc/fixedstringarray.pmc
trunk/src/pmc/float.pmc
trunk/src/pmc/hash.pmc
trunk/src/pmc/object.pmc
trunk/src/pmc/parrotinterpreter.pmc
trunk/src/pmc/unmanagedstruct.pmc
Modified: trunk/src/pmc/fixedintegerarray.pmc
==============================================================================
--- trunk/src/pmc/fixedintegerarray.pmc Sat Aug 1 21:49:43 2009 (r40364)
+++ trunk/src/pmc/fixedintegerarray.pmc Sat Aug 1 22:10:42 2009 (r40365)
@@ -155,6 +155,7 @@
if (int_array)
mem_sys_free(int_array);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: trunk/src/pmc/fixedpmcarray.pmc
==============================================================================
--- trunk/src/pmc/fixedpmcarray.pmc Sat Aug 1 21:49:43 2009 (r40364)
+++ trunk/src/pmc/fixedpmcarray.pmc Sat Aug 1 22:10:42 2009 (r40365)
@@ -87,6 +87,7 @@
mem_sys_free(PMC_array(SELF));
}
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: trunk/src/pmc/fixedstringarray.pmc
==============================================================================
--- trunk/src/pmc/fixedstringarray.pmc Sat Aug 1 21:49:43 2009 (r40364)
+++ trunk/src/pmc/fixedstringarray.pmc Sat Aug 1 22:10:42 2009 (r40365)
@@ -69,6 +69,7 @@
mem_sys_free(str_array);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: trunk/src/pmc/float.pmc
==============================================================================
--- trunk/src/pmc/float.pmc Sat Aug 1 21:49:43 2009 (r40364)
+++ trunk/src/pmc/float.pmc Sat Aug 1 22:10:42 2009 (r40365)
@@ -34,8 +34,8 @@
VTABLE void init() {
Parrot_Float_attributes * const fattr = mem_allocate_zeroed_typed(Parrot_Float_attributes);
- fattr->fv = 0.0;
PMC_data(SELF) = fattr;
+ SET_ATTR_fv(INTERP, SELF, 0.0);
PObj_active_destroy_SET(SELF);
}
@@ -51,6 +51,7 @@
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: trunk/src/pmc/hash.pmc
==============================================================================
--- trunk/src/pmc/hash.pmc Sat Aug 1 21:49:43 2009 (r40364)
+++ trunk/src/pmc/hash.pmc Sat Aug 1 22:10:42 2009 (r40365)
@@ -409,6 +409,7 @@
parrot_hash_destroy(INTERP, hash);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: trunk/src/pmc/object.pmc
==============================================================================
--- trunk/src/pmc/object.pmc Sat Aug 1 21:49:43 2009 (r40364)
+++ trunk/src/pmc/object.pmc Sat Aug 1 22:10:42 2009 (r40365)
@@ -153,6 +153,7 @@
*/
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: trunk/src/pmc/parrotinterpreter.pmc
==============================================================================
--- trunk/src/pmc/parrotinterpreter.pmc Sat Aug 1 21:49:43 2009 (r40364)
+++ trunk/src/pmc/parrotinterpreter.pmc Sat Aug 1 22:10:42 2009 (r40365)
@@ -277,8 +277,10 @@
*/
VTABLE void destroy() {
- if (PMC_data(SELF))
+ if (PMC_data(SELF)) {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
+ }
}
Modified: trunk/src/pmc/unmanagedstruct.pmc
==============================================================================
--- trunk/src/pmc/unmanagedstruct.pmc Sat Aug 1 21:49:43 2009 (r40364)
+++ trunk/src/pmc/unmanagedstruct.pmc Sat Aug 1 22:10:42 2009 (r40365)
@@ -691,6 +691,7 @@
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
More information about the parrot-commits
mailing list