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

ruby-changes:31797

From: tmm1 <ko1@a...>
Date: Wed, 27 Nov 2013 15:24:42 +0900 (JST)
Subject: [ruby-changes:31797] tmm1:r43876 (trunk): * gc.c (gc_page_sweep): Fix compile warning from last commit.

tmm1	2013-11-27 15:24:37 +0900 (Wed, 27 Nov 2013)

  New Revision: 43876

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

  Log:
    * gc.c (gc_page_sweep): Fix compile warning from last commit.
    * hash.c (hash_aset_str): Re-use existing variable to avoid
      unnecessary pointer dereferencing.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
    trunk/hash.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43875)
+++ ChangeLog	(revision 43876)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Nov 27 15:21:17 2013  Aman Gupta <ruby@t...>
+
+	* gc.c (gc_page_sweep): Fix compile warning from last commit.
+	* hash.c (hash_aset_str): Re-use existing variable to avoid
+	  unnecessary pointer dereferencing.
+
 Wed Nov 27 15:12:55 2013  Koichi Sasada  <ko1@a...>
 
 	* gc.c (gc_page_sweep): disable debug print.
Index: gc.c
===================================================================
--- gc.c	(revision 43875)
+++ gc.c	(revision 43876)
@@ -2745,7 +2745,7 @@ gc_page_sweep(rb_objspace_t *objspace, r https://github.com/ruby/ruby/blob/trunk/gc.c#L2745
     if (0) fprintf(stderr, "gc_page_sweep(%d): freed?: %d, limt: %d, freed_slots: %d, empty_slots: %d, final_slots: %d\n",
 		   (int)rb_gc_count(),
 		   final_slots + freed_slots + empty_slots == sweep_page->limit,
-		   (int)sweep_page->limit, (int)freed_slots, (int)empty_slots, final_slots);
+		   (int)sweep_page->limit, (int)freed_slots, (int)empty_slots, (int)final_slots);
 
     if (heap_pages_deferred_final && !finalizing) {
         rb_thread_t *th = GET_THREAD();
Index: hash.c
===================================================================
--- hash.c	(revision 43875)
+++ hash.c	(revision 43876)
@@ -1264,7 +1264,7 @@ hash_aset_str(st_data_t *key, st_data_t https://github.com/ruby/ruby/blob/trunk/hash.c#L1264
     if (!existing) {
 	VALUE str = (VALUE)*key;
 	if (!OBJ_FROZEN(str))
-	    *key = rb_fstring((VALUE)*key);
+	    *key = rb_fstring(str);
     }
     return hash_aset(key, val, arg, existing);
 }

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

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