[前][次][番号順一覧][スレッド一覧]

ruby-changes:33783

From: nobu <ko1@a...>
Date: Thu, 8 May 2014 00:43:44 +0900 (JST)
Subject: [ruby-changes:33783] nobu:r45864 (trunk): gc.c: fix argument types for st_foreach

nobu	2014-05-08 00:43:37 +0900 (Thu, 08 May 2014)

  New Revision: 45864

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45864

  Log:
    gc.c: fix argument types for st_foreach
    
    * gc.c ({free,mark}_{method,const}_entry_i): fix argument types as
      st_data_t for st_foreach().
    
    * gc.c (rgengc_unprotect_logging_exit_func_i): add third argument.

  Modified files:
    trunk/gc.c
Index: gc.c
===================================================================
--- gc.c	(revision 45863)
+++ gc.c	(revision 45864)
@@ -1454,8 +1454,9 @@ is_pointer_to_heap(rb_objspace_t *objspa https://github.com/ruby/ruby/blob/trunk/gc.c#L1454
 }
 
 static int
-free_method_entry_i(ID key, rb_method_entry_t *me, st_data_t data)
+free_method_entry_i(st_data_t key, st_data_t value, st_data_t data)
 {
+    rb_method_entry_t *me = (rb_method_entry_t *)value;
     if (!me->mark) {
 	rb_free_method_entry(me);
     }
@@ -1479,8 +1480,9 @@ rb_free_m_tbl_wrapper(struct method_tabl https://github.com/ruby/ruby/blob/trunk/gc.c#L1480
 }
 
 static int
-free_const_entry_i(ID key, rb_const_entry_t *ce, st_data_t data)
+free_const_entry_i(st_data_t key, st_data_t value, st_data_t data)
 {
+    rb_const_entry_t *ce = (rb_const_entry_t *)value;
     xfree(ce);
     return ST_CONTINUE;
 }
@@ -3447,8 +3449,9 @@ rb_mark_method_entry(const rb_method_ent https://github.com/ruby/ruby/blob/trunk/gc.c#L3449
 }
 
 static int
-mark_method_entry_i(ID key, const rb_method_entry_t *me, st_data_t data)
+mark_method_entry_i(st_data_t key, st_data_t value, st_data_t data)
 {
+    const rb_method_entry_t *me = (const rb_method_entry_t *)value;
     struct mark_tbl_arg *arg = (void*)data;
     mark_method_entry(arg->objspace, me);
     return ST_CONTINUE;
@@ -3471,8 +3474,9 @@ mark_m_tbl_wrapper(rb_objspace_t *objspa https://github.com/ruby/ruby/blob/trunk/gc.c#L3474
 }
 
 static int
-mark_const_entry_i(ID key, const rb_const_entry_t *ce, st_data_t data)
+mark_const_entry_i(st_data_t key, st_data_t value, st_data_t data)
 {
+    const rb_const_entry_t *ce = (const rb_const_entry_t *)value;
     struct mark_tbl_arg *arg = (void*)data;
     gc_mark(arg->objspace, ce->value);
     gc_mark(arg->objspace, ce->file);
@@ -4838,7 +4842,7 @@ rb_gc_writebarrier_remember_promoted(VAL https://github.com/ruby/ruby/blob/trunk/gc.c#L4842
 static st_table *rgengc_unprotect_logging_table;
 
 static int
-rgengc_unprotect_logging_exit_func_i(st_data_t key, st_data_t val)
+rgengc_unprotect_logging_exit_func_i(st_data_t key, st_data_t val, st_data_t arg)
 {
     fprintf(stderr, "%s\t%d\n", (char *)key, (int)val);
     return ST_CONTINUE;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]