[svn:parrot] r44081 - branches/sys_mem_reduce/src/dynpmc
bacek at svn.parrot.org
bacek at svn.parrot.org
Wed Feb 17 10:28:16 UTC 2010
Author: bacek
Date: Wed Feb 17 10:28:15 2010
New Revision: 44081
URL: https://trac.parrot.org/parrot/changeset/44081
Log:
Switch GDBMHash PMC to auto_attrs
Modified:
branches/sys_mem_reduce/src/dynpmc/gdbmhash.pmc
Modified: branches/sys_mem_reduce/src/dynpmc/gdbmhash.pmc
==============================================================================
--- branches/sys_mem_reduce/src/dynpmc/gdbmhash.pmc Wed Feb 17 10:27:57 2010 (r44080)
+++ branches/sys_mem_reduce/src/dynpmc/gdbmhash.pmc Wed Feb 17 10:28:15 2010 (r44081)
@@ -73,7 +73,7 @@
}
-pmclass GDBMHash provides hash dynpmc lib gdbm {
+pmclass GDBMHash provides hash dynpmc lib gdbm auto_attrs {
ATTR struct GDBM_FH *db_handle;
/*
@@ -100,18 +100,14 @@
}
VTABLE void init() {
- Parrot_GDBMHash_attributes *attrs =
- mem_allocate_zeroed_typed(Parrot_GDBMHash_attributes);
-
+ Parrot_GDBMHash_attributes *attrs = PARROT_GDBMHASH(SELF);
attrs->db_handle = mem_allocate_zeroed_typed(GDBM_FH);
- PMC_data(SELF) = attrs;
PObj_custom_destroy_SET(SELF);
}
VTABLE void destroy() {
- mem_sys_free(
- ((Parrot_GDBMHash_attributes *)PMC_data(SELF))->db_handle);
- mem_sys_free(PMC_data(SELF));
+ Parrot_GDBMHash_attributes *attrs = PARROT_GDBMHASH(SELF);
+ mem_sys_free(attrs->db_handle);
PMC_data(SELF) = NULL;
}
More information about the parrot-commits
mailing list