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

ruby-changes:56986

From: Aaron <ko1@a...>
Date: Tue, 13 Aug 2019 01:34:37 +0900 (JST)
Subject: [ruby-changes:56986] Aaron Patterson: 6749682f82 (master): also unpin `final` on weak maps

https://git.ruby-lang.org/ruby.git/commit/?id=6749682f82

From 6749682f8225b50bc91a45af0f27f20ff68d473c Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Fri, 9 Aug 2019 16:27:43 -0700
Subject: also unpin `final` on weak maps


diff --git a/gc.c b/gc.c
index 68c45e0..1ac39bb 100644
--- a/gc.c
+++ b/gc.c
@@ -10135,6 +10135,7 @@ wmap_compact(void *ptr) https://github.com/ruby/ruby/blob/trunk/gc.c#L10135
     struct weakmap *w = ptr;
     if (w->wmap2obj) rb_gc_update_tbl_refs(w->wmap2obj);
     if (w->obj2wmap) rb_gc_update_tbl_refs(w->obj2wmap);
+    w->final = rb_gc_location(w->final);
 }
 
 static void
@@ -10144,7 +10145,7 @@ wmap_mark(void *ptr) https://github.com/ruby/ruby/blob/trunk/gc.c#L10145
 #if WMAP_DELETE_DEAD_OBJECT_IN_MARK
     if (w->obj2wmap) st_foreach(w->obj2wmap, wmap_mark_map, (st_data_t)&rb_objspace);
 #endif
-    rb_gc_mark(w->final);
+    rb_gc_mark_no_pin(w->final);
 }
 
 static int
-- 
cgit v0.10.2


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

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