[svn:parrot] r49042 - branches/string_gc_split/src/gc

bacek at svn.parrot.org bacek at svn.parrot.org
Thu Sep 16 08:36:17 UTC 2010


Author: bacek
Date: Thu Sep 16 08:36:17 2010
New Revision: 49042
URL: https://trac.parrot.org/parrot/changeset/49042

Log:
Add void* data for strings iterator.

Modified:
   branches/string_gc_split/src/gc/gc_ms.c
   branches/string_gc_split/src/gc/gc_private.h

Modified: branches/string_gc_split/src/gc/gc_ms.c
==============================================================================
--- branches/string_gc_split/src/gc/gc_ms.c	Thu Sep 16 08:35:50 2010	(r49041)
+++ branches/string_gc_split/src/gc/gc_ms.c	Thu Sep 16 08:36:17 2010	(r49042)
@@ -163,7 +163,8 @@
         __attribute__nonnull__(1);
 
 static void gc_ms_iterate_live_strings(PARROT_INTERP,
-    string_iterator_callback callback)
+    string_iterator_callback callback,
+    ARGIN_NULLOK(void *data))
         __attribute__nonnull__(1);
 
 static void gc_ms_mark_and_sweep(PARROT_INTERP, UINTVAL flags)
@@ -1887,7 +1888,7 @@
 
 /*
 =item C<static void gc_ms_iterate_live_strings(PARROT_INTERP,
-string_iterator_callback callback)>
+string_iterator_callback callback, void *data)>
 
 Iterate over live string invoking callback for each of them. Used during
 compacting of string pool.
@@ -1895,7 +1896,9 @@
 =cut
 */
 static void
-gc_ms_iterate_live_strings(PARROT_INTERP, string_iterator_callback callback)
+gc_ms_iterate_live_strings(PARROT_INTERP,
+        string_iterator_callback callback,
+        ARGIN_NULLOK(void *data))
 {
     ASSERT_ARGS(gc_ms_iterate_live_strings)
 
@@ -1921,7 +1924,7 @@
             const size_t objects_end = cur_buffer_arena->used;
 
             for (i = objects_end; i; --i) {
-                callback(interp, b);
+                callback(interp, b, data);
                 b = (Buffer *)((char *)b + object_size);
             }
         }

Modified: branches/string_gc_split/src/gc/gc_private.h
==============================================================================
--- branches/string_gc_split/src/gc/gc_private.h	Thu Sep 16 08:35:50 2010	(r49041)
+++ branches/string_gc_split/src/gc/gc_private.h	Thu Sep 16 08:36:17 2010	(r49042)
@@ -92,7 +92,7 @@
 } gc_skip_type_enum;
 
 /* Callback for live string. Use Buffer for now... */
-typedef void (*string_iterator_callback)(PARROT_INTERP, Buffer *str);
+typedef void (*string_iterator_callback)(PARROT_INTERP, Buffer *str, void *data);
 
 typedef struct GC_Subsystem {
     /* Which GC subsystem are we using? See PARROT_GC_DEFAULT_TYPE in
@@ -152,7 +152,7 @@
     size_t (*get_gc_info)(PARROT_INTERP, Interpinfo_enum);
 
     /* Iterate over _live_ strings. Used for string pool compacting */
-    void (*iterate_live_strings)(PARROT_INTERP, string_iterator_callback callback);
+    void (*iterate_live_strings)(PARROT_INTERP, string_iterator_callback callback, void *data);
 
     /*Function hooks that GC systems can CHOOSE to provide if they need them
      *These will be called via the GC API functions Parrot_gc_func_name


More information about the parrot-commits mailing list