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

ruby-changes:59687

From: Koichi <ko1@a...>
Date: Mon, 13 Jan 2020 03:44:06 +0900 (JST)
Subject: [ruby-changes:59687] 350dafd56a (master): reload AR table body for transient heap.

https://git.ruby-lang.org/ruby.git/commit/?id=350dafd56a

From 350dafd56a9cff58d36303aeb7515ab41c5dbbb3 Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Mon, 13 Jan 2020 03:36:47 +0900
Subject: reload AR table body for transient heap.

ar_talbe (Hash representation for <=8 size) can use transient heap
and the memory area can move. So we need to restore `pair' ptr after
`func` call (which can run any programs) because of moving.

diff --git a/hash.c b/hash.c
index 878f2b1..644f85d 100644
--- a/hash.c
+++ b/hash.c
@@ -974,6 +974,7 @@ ar_foreach_check(VALUE hash, st_foreach_check_callback_func *func, st_data_t arg https://github.com/ruby/ruby/blob/trunk/hash.c#L974
 
             switch (retval) {
               case ST_CHECK: {
+                  pair = RHASH_AR_TABLE_REF(hash, i);
                   if (pair->key == never) break;
                   ret = ar_find_entry_hint(hash, hint, key);
                   if (ret == RHASH_AR_TABLE_MAX_BOUND) {
-- 
cgit v0.10.2


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

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