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

ruby-changes:43946

From: nagachika <ko1@a...>
Date: Sat, 27 Aug 2016 04:01:54 +0900 (JST)
Subject: [ruby-changes:43946] nagachika:r56019 (ruby_2_3): merge revision(s) 55896: [Backport #12614]

nagachika	2016-08-27 04:01:49 +0900 (Sat, 27 Aug 2016)

  New Revision: 56019

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

  Log:
    merge revision(s) 55896: [Backport #12614]
    
    * id_table.c (hash_table_extend): should not shrink the table than
      the previous capacity.  [ruby-core:76534] [Bug #12614]

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/id_table.c
    branches/ruby_2_3/version.h
Index: ruby_2_3/id_table.c
===================================================================
--- ruby_2_3/id_table.c	(revision 56018)
+++ ruby_2_3/id_table.c	(revision 56019)
@@ -1302,6 +1302,9 @@ hash_table_extend(struct hash_id_table* https://github.com/ruby/ruby/blob/trunk/ruby_2_3/id_table.c#L1302
 	int i;
 	item_t* old;
 	struct hash_id_table tmp_tbl = {0, 0, 0};
+	if (new_cap < tbl->capa) {
+	    new_cap = round_capa(tbl->used + (tbl->used >> 1));
+	}
 	tmp_tbl.capa = new_cap;
 	tmp_tbl.items = ZALLOC_N(item_t, new_cap);
 	for (i = 0; i < tbl->capa; i++) {
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 56018)
+++ ruby_2_3/ChangeLog	(revision 56019)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Sat Aug 27 03:51:23 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* id_table.c (hash_table_extend): should not shrink the table than
+	  the previous capacity.  [ruby-core:76534] [Bug #12614]
+
 Sat Aug 27 03:37:49 2016  Kazuki Yamaguchi  <k@r...>
 
 	* ext/openssl/ossl_config.c: fix memory leak.
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 56018)
+++ ruby_2_3/version.h	(revision 56019)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.2"
 #define RUBY_RELEASE_DATE "2016-08-27"
-#define RUBY_PATCHLEVEL 179
+#define RUBY_PATCHLEVEL 180
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 8

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r55896


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

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