[svn:parrot] r40443 - in branches/auto_attrs/src: dynpmc pmc
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Fri Aug 7 19:28:38 UTC 2009
Author: NotFound
Date: Fri Aug 7 19:28:36 2009
New Revision: 40443
URL: https://trac.parrot.org/parrot/changeset/40443
Log:
set auto_attrs in several critical PMCs
Modified:
branches/auto_attrs/src/dynpmc/foo.pmc
branches/auto_attrs/src/dynpmc/foo2.pmc
branches/auto_attrs/src/dynpmc/rotest.pmc
branches/auto_attrs/src/pmc/boolean.pmc
branches/auto_attrs/src/pmc/fixedpmcarray.pmc
branches/auto_attrs/src/pmc/integer.pmc
branches/auto_attrs/src/pmc/resizablepmcarray.pmc
Modified: branches/auto_attrs/src/dynpmc/foo.pmc
==============================================================================
--- branches/auto_attrs/src/dynpmc/foo.pmc Fri Aug 7 17:29:14 2009 (r40442)
+++ branches/auto_attrs/src/dynpmc/foo.pmc Fri Aug 7 19:28:36 2009 (r40443)
@@ -8,7 +8,7 @@
* proper inheritance - for testing only
*/
-pmclass Foo dynpmc group foo_group provides scalar extends Integer {
+pmclass Foo dynpmc group foo_group provides scalar extends Integer auto_attrs {
VTABLE INTVAL get_integer() {
return 42;
Modified: branches/auto_attrs/src/dynpmc/foo2.pmc
==============================================================================
--- branches/auto_attrs/src/dynpmc/foo2.pmc Fri Aug 7 17:29:14 2009 (r40442)
+++ branches/auto_attrs/src/dynpmc/foo2.pmc Fri Aug 7 19:28:36 2009 (r40443)
@@ -8,7 +8,7 @@
* proper inheritance - for testing only
*/
-pmclass Foo2 dynpmc group foo_group provides scalar extends Foo {
+pmclass Foo2 dynpmc group foo_group provides scalar extends Foo auto_attrs {
VTABLE INTVAL get_integer() {
INTVAL i = SUPER();
Modified: branches/auto_attrs/src/dynpmc/rotest.pmc
==============================================================================
--- branches/auto_attrs/src/dynpmc/rotest.pmc Fri Aug 7 17:29:14 2009 (r40442)
+++ branches/auto_attrs/src/dynpmc/rotest.pmc Fri Aug 7 19:28:36 2009 (r40443)
@@ -8,7 +8,7 @@
* generation. For testing only.
*/
-pmclass ROTest dynpmc provides scalar extends Integer {
+pmclass ROTest dynpmc provides scalar extends Integer auto_attrs {
VTABLE void set_integer_native(INTVAL value) :read {
}
VTABLE INTVAL get_integer() :write {
Modified: branches/auto_attrs/src/pmc/boolean.pmc
==============================================================================
--- branches/auto_attrs/src/pmc/boolean.pmc Fri Aug 7 17:29:14 2009 (r40442)
+++ branches/auto_attrs/src/pmc/boolean.pmc Fri Aug 7 19:28:36 2009 (r40443)
@@ -21,7 +21,7 @@
*/
-pmclass Boolean extends Integer provides boolean provides scalar {
+pmclass Boolean extends Integer provides boolean provides scalar auto_attrs {
/*
Modified: branches/auto_attrs/src/pmc/fixedpmcarray.pmc
==============================================================================
--- branches/auto_attrs/src/pmc/fixedpmcarray.pmc Fri Aug 7 17:29:14 2009 (r40442)
+++ branches/auto_attrs/src/pmc/fixedpmcarray.pmc Fri Aug 7 19:28:36 2009 (r40443)
@@ -27,7 +27,7 @@
#define PMC_size(x) ((Parrot_FixedPMCArray_attributes *)PMC_data(x))->size
#define PMC_array(x) ((Parrot_FixedPMCArray_attributes *)PMC_data(x))->pmc_array
-pmclass FixedPMCArray need_ext provides array {
+pmclass FixedPMCArray need_ext auto_attrs provides array {
ATTR INTVAL size; /* number of elements in the array */
ATTR PMC **pmc_array; /* pointer to PMC array */
@@ -66,9 +66,7 @@
VTABLE void init() {
Parrot_FixedPMCArray_attributes *attrs =
- mem_allocate_zeroed_typed(Parrot_FixedPMCArray_attributes);
-
- PMC_data(SELF) = attrs;
+ (Parrot_FixedPMCArray_attributes *) PMC_data(SELF);
PObj_custom_mark_destroy_SETALL(SELF);
}
@@ -86,8 +84,6 @@
if (PMC_array(SELF)) {
mem_sys_free(PMC_array(SELF));
}
- mem_sys_free(PMC_data(SELF));
- PMC_data(SELF) = NULL;
}
/*
Modified: branches/auto_attrs/src/pmc/integer.pmc
==============================================================================
--- branches/auto_attrs/src/pmc/integer.pmc Fri Aug 7 17:29:14 2009 (r40442)
+++ branches/auto_attrs/src/pmc/integer.pmc Fri Aug 7 19:28:36 2009 (r40443)
@@ -43,7 +43,7 @@
return self;
}
-pmclass Integer extends scalar provides integer provides scalar {
+pmclass Integer extends scalar provides integer provides scalar auto_attrs {
ATTR INTVAL iv; /* the value of this Integer */
/*
@@ -91,16 +91,13 @@
VTABLE void init() {
Parrot_Integer_attributes * const attrs =
- mem_allocate_typed(Parrot_Integer_attributes);
+ (Parrot_Integer_attributes *)PMC_data(SELF);
attrs->iv = 0;
- PMC_data(SELF) = attrs;
PObj_active_destroy_SET(SELF);
}
VTABLE void destroy() {
- mem_sys_free(PMC_data(SELF));
- PMC_data(SELF) = NULL;
}
/*
Modified: branches/auto_attrs/src/pmc/resizablepmcarray.pmc
==============================================================================
--- branches/auto_attrs/src/pmc/resizablepmcarray.pmc Fri Aug 7 17:29:14 2009 (r40442)
+++ branches/auto_attrs/src/pmc/resizablepmcarray.pmc Fri Aug 7 19:28:36 2009 (r40443)
@@ -23,7 +23,7 @@
#define PMC_array(x) ((Parrot_ResizablePMCArray_attributes *)PMC_data(x))->pmc_array
#define PMC_threshold(x) ((Parrot_ResizablePMCArray_attributes *)PMC_data(x))->resize_threshold
-pmclass ResizablePMCArray extends FixedPMCArray need_ext provides array {
+pmclass ResizablePMCArray extends FixedPMCArray need_ext auto_attrs provides array {
ATTR INTVAL resize_threshold; /* max size before array needs resizing */
@@ -37,10 +37,6 @@
*/
VTABLE void init() {
- Parrot_ResizablePMCArray_attributes *attrs =
- mem_allocate_zeroed_typed(Parrot_ResizablePMCArray_attributes);
-
- PMC_data(SELF) = attrs;
PObj_custom_mark_destroy_SETALL(SELF);
}
More information about the parrot-commits
mailing list