[svn:parrot] r35652 - trunk/src/pmc

[email protected]
Newsgroups perl.cvs.parrot
Message-ID <[email protected]>
Author: cotto
Date: Fri Jan 16 14:29:11 2009
New Revision: 35652

Modified:
   trunk/src/pmc/capture.pmc

Log:
[pmc] convert unionval to ATTR in the Capture PMC


Modified: trunk/src/pmc/capture.pmc
==============================================================================
--- trunk/src/pmc/capture.pmc	(original)
+++ trunk/src/pmc/capture.pmc	Fri Jan 16 14:29:11 2009
@@ -30,8 +30,9 @@
         PARROT_CAPTURE(obj)->hash = pmc_new((i), enum_class_Hash);
 
 pmclass Capture need_ext {
-    ATTR PMC *array;
-    ATTR PMC *hash;
+    ATTR PMC    *array;
+    ATTR PMC    *hash;
+    ATTR INTVAL  data_size;
 
 /*
 
@@ -52,7 +53,7 @@
         PMC_data(SELF)          = capture;
         capture->array          = NULL;
         capture->hash           = NULL;
-        PMC_int_val(SELF)       = CAPTURE_DATA_SIZE;
+        capture->data_size      = CAPTURE_DATA_SIZE;
         PObj_active_destroy_SET(SELF);
         PObj_custom_mark_SET(SELF);
     }
@@ -62,8 +63,6 @@
             mem_sys_free(PARROT_CAPTURE(SELF));
             PMC_data(SELF) = NULL;
         }
-
-        PMC_int_val(SELF)  = 0;
     }
 
 /*
@@ -524,7 +523,8 @@
         if (!data)
             return;
 
-        for (i = PMC_int_val(SELF) - 1; i >= 0; --i)
+        GET_ATTR_data_size(INTERP, SELF, i);
+        for (i = i - 1; i >= 0; --i)
             if (data[i])
                 pobject_lives(interp, (PObj *)data[i]);
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.