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

ruby-changes:30991

From: ko1 <ko1@a...>
Date: Fri, 27 Sep 2013 17:20:29 +0900 (JST)
Subject: [ruby-changes:30991] ko1:r43070 (trunk): * gc.c (gc_before_sweep): cast to size_t to suppress warnings.

ko1	2013-09-27 17:20:19 +0900 (Fri, 27 Sep 2013)

  New Revision: 43070

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

  Log:
    * gc.c (gc_before_sweep): cast to size_t to suppress warnings.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43069)
+++ ChangeLog	(revision 43070)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Sep 27 17:19:39 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (gc_before_sweep): cast to size_t to suppress warnings.
+
 Fri Sep 27 17:07:55 2013  Koichi Sasada  <ko1@a...>
 
 	* gc.c: add some fine-grained profiling codes to tuning marking phase.
Index: gc.c
===================================================================
--- gc.c	(revision 43069)
+++ gc.c	(revision 43070)
@@ -2405,13 +2405,13 @@ gc_before_sweep(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L2405
 	size_t old_limit = malloc_limit;
 
 	if (inc > malloc_limit) {
-	    malloc_limit += malloc_limit * (initial_params.initial_malloc_limit_factor - 1); /* 1 > factor */
+	    malloc_limit += (size_t)(malloc_limit * (initial_params.initial_malloc_limit_factor - 1));
 	    if (malloc_limit > initial_malloc_limit_max) {
 		malloc_limit = initial_malloc_limit_max;
 	    }
 	}
 	else {
-	    malloc_limit -= malloc_limit * ((initial_params.initial_malloc_limit_factor - 1) / 4);
+	    malloc_limit -= (size_t)(malloc_limit * ((initial_params.initial_malloc_limit_factor - 1) / 4));
 	    if (malloc_limit < initial_malloc_limit) {
 		malloc_limit = initial_malloc_limit;
 	    }

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

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