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

ruby-changes:38867

From: ko1 <ko1@a...>
Date: Thu, 18 Jun 2015 17:01:32 +0900 (JST)
Subject: [ruby-changes:38867] ko1:r50948 (trunk): * method.h: constify rb_method_alias_struct::original_me and

ko1	2015-06-18 17:01:13 +0900 (Thu, 18 Jun 2015)

  New Revision: 50948

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

  Log:
    * method.h: constify rb_method_alias_struct::original_me and
      rb_method_refined_struct::orig_me.
    * class.c (move_refined_method): use RB_OBJ_WRITE() for
      me->def->body.refined.orig_me.

  Modified files:
    trunk/ChangeLog
    trunk/class.c
    trunk/method.h
Index: method.h
===================================================================
--- method.h	(revision 50947)
+++ method.h	(revision 50948)
@@ -122,11 +122,11 @@ typedef struct rb_method_attr_struct { https://github.com/ruby/ruby/blob/trunk/method.h#L122
 } rb_method_attr_t;
 
 typedef struct rb_method_alias_struct {
-    const struct rb_method_entry_struct *original_me; /* original_me->klass is original owner */
+    const struct rb_method_entry_struct * const original_me; /* original_me->klass is original owner */
 } rb_method_alias_t;
 
 typedef struct rb_method_refined_struct {
-    const struct rb_method_entry_struct *orig_me;
+    const struct rb_method_entry_struct * const orig_me;
 } rb_method_refined_t;
 
 typedef struct rb_method_definition_struct {
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50947)
+++ ChangeLog	(revision 50948)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jun 18 16:58:35 2015  Koichi Sasada  <ko1@a...>
+
+	* method.h: constify rb_method_alias_struct::original_me and
+	  rb_method_refined_struct::orig_me.
+
+	* class.c (move_refined_method): use RB_OBJ_WRITE() for 
+	  me->def->body.refined.orig_me.
+
 Thu Jun 18 14:35:28 2015  Koichi Sasada  <ko1@a...>
 
 	* ext/objspace/objspace.c (count_imemo_objects): support imemo_ment.
Index: class.c
===================================================================
--- class.c	(revision 50947)
+++ class.c	(revision 50948)
@@ -915,7 +915,7 @@ move_refined_method(st_data_t key, st_da https://github.com/ruby/ruby/blob/trunk/class.c#L915
     if (me->def->type == VM_METHOD_TYPE_REFINED) {
 	if (me->def->body.refined.orig_me) {
 	    const rb_method_entry_t *orig_me = me->def->body.refined.orig_me, *new_me;
-	    me->def->body.refined.orig_me = NULL;
+	    RB_OBJ_WRITE(me, &me->def->body.refined.orig_me, NULL);
 	    new_me = rb_method_entry_clone(me);
 	    st_add_direct(tbl, key, (st_data_t) new_me);
 	    rb_method_entry_copy(me, orig_me);

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

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