[svn:parrot] r43668 - branches/pmc_freeze_with_pmcs/src/pmc

darbelo at svn.parrot.org darbelo at svn.parrot.org
Sun Jan 31 18:53:13 UTC 2010


Author: darbelo
Date: Sun Jan 31 18:53:11 2010
New Revision: 43668
URL: https://trac.parrot.org/parrot/changeset/43668

Log:
Fix copypasta errors.
Misapropiate the set_pointer() VTABLE to poke at thaw_ptr.

Modified:
   branches/pmc_freeze_with_pmcs/src/pmc/imageio.pmc

Modified: branches/pmc_freeze_with_pmcs/src/pmc/imageio.pmc
==============================================================================
--- branches/pmc_freeze_with_pmcs/src/pmc/imageio.pmc	Sun Jan 31 18:25:05 2010	(r43667)
+++ branches/pmc_freeze_with_pmcs/src/pmc/imageio.pmc	Sun Jan 31 18:53:11 2010	(r43668)
@@ -12,6 +12,8 @@
 
 */
 
+#define GROW_TO_16_BYTE_BOUNDARY(size) ((size) + ((size) % 16 ? 16 - (size) % 16 : 0))
+
 /* when thawing a string longer then this size, we first do a GC run and then
  * block GC - the system can't give us more headers */
 
@@ -51,7 +53,7 @@
 
 PARROT_INLINE
 static void
-INC_VISIT_CURSOR(PMC *pmc, unsigned int inc) {
+INC_VISIT_CURSOR(PMC *pmc, UINTVAL inc) {
     PARROT_IMAGEIO(pmc)->pos += inc;
 }
 
@@ -59,6 +61,7 @@
     PARROT_IMAGEIO(pmc)->pos <= PARROT_IMAGEIO(pmc)->input_length )
 
 
+
 /*
 static void ensure_buffer_size(PARROT_INTERP, PMC *io, size_t len)
 
@@ -90,13 +93,8 @@
 
 }
 
-PARROT_INLINE
-static INTVAL
-INFO_HAS_DATA(ARGIN(PMC *io)) {
-    return PARROT_IMAGEIO(io)->pos < PARROT_IMAGEIO(io)->input_length;
-}
-
 pmclass ImageIO auto_attrs {
+    ATTR visit_f          visit_pmc_now;
     ATTR Buffer          *buffer;         /* buffer to store the image */
     ATTR size_t           pos;            /* current read/write position in buffer */
     ATTR size_t           input_length;
@@ -109,7 +107,8 @@
     ATTR INTVAL           extra_flags;    /* concerning to extra */
     ATTR struct PackFile *pf;
 
-*/
+/*
+
 =head1 VTABLES
 
 =over 4
@@ -128,6 +127,7 @@
 
 */
     VTABLE void init() {
+        PARROT_IMAGEIO(SELF)->thaw_ptr    = NULL;
         PARROT_IMAGEIO(SELF)->buffer      = NULL;
         PARROT_IMAGEIO(SELF)->todo        = pmc_new(INTERP, enum_class_Array);
         PARROT_IMAGEIO(SELF)->seen        = PMCNULL;
@@ -169,6 +169,8 @@
         Parrot_gc_mark_PMC_alive(INTERP, PARROT_IMAGEIO(SELF)->id_list);
     }
 
+/*
+
 =item C<STRING *get_string()>
 
 Returns the content of the image as a string.
@@ -186,6 +188,20 @@
 
 /*
 
+=item C<VTABLE void set_pointer()>
+
+Sets the location where to thaw a new PMC.
+
+=cut
+
+*/
+
+VTABLE void set_pointer(void* value) {
+    PARROT_IMAGEIO(SELF)->thaw_ptr = value;
+}
+
+/*
+
 =item C<VTABLE INTVAL get_integer()>
 
 Returns the flags describing the visit action
@@ -208,9 +224,7 @@
 
 */
 
-static void
-push_opcode_integer(PARROT_INTERP, ARGIN(visit_info *io), INTVAL v)
-{
+VTABLE void push_integer(INTVAL v) {
     size_t len = PF_size_integer() * sizeof (opcode_t);
     ensure_buffer_size(interp, SELF, len);
     SET_VISIT_CURSOR(SELF, PF_store_integer(GET_VISIT_CURSOR(SELF), v));
@@ -298,7 +312,7 @@
 
 */
 
-VTABLE FLOATVAL shift__number() {
+VTABLE FLOATVAL shift_number() {
     opcode_t *pos    = GET_VISIT_CURSOR(SELF);
     const FLOATVAL f = PF_fetch_number(PARROT_IMAGEIO(SELF)->pf, (const opcode_t **)&pos);
     SET_VISIT_CURSOR(SELF, pos);
@@ -317,7 +331,7 @@
 
 */
 
-VTABLE  STRING *shift__string()
+VTABLE STRING *shift_string()
 {
     opcode_t *pos    = GET_VISIT_CURSOR(SELF);
     STRING * const s = PF_fetch_string(interp, PARROT_IMAGEIO(SELF)->pf, (const opcode_t **)&pos);
@@ -343,6 +357,7 @@
     return result;
 }
 
+/*
 
 =back
 


More information about the parrot-commits mailing list