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

ruby-changes:56991

From: Nobuyoshi <ko1@a...>
Date: Tue, 13 Aug 2019 09:50:38 +0900 (JST)
Subject: [ruby-changes:56991] Nobuyoshi Nakada: ac656bc2bd (master): Hoisted out GPR_DEFAULT_REASON

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

From ac656bc2bda6c7879b4b2170b7c2386a08112689 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 13 Aug 2019 09:43:11 +0900
Subject: Hoisted out GPR_DEFAULT_REASON


diff --git a/gc.c b/gc.c
index 1d70355..1758b3f 100644
--- a/gc.c
+++ b/gc.c
@@ -348,7 +348,11 @@ typedef enum { https://github.com/ruby/ruby/blob/trunk/gc.c#L348
     GPR_FLAG_IMMEDIATE_SWEEP   = 0x2000,
     GPR_FLAG_HAVE_FINALIZE     = 0x4000,
     GPR_FLAG_IMMEDIATE_MARK    = 0x8000,
-    GPR_FLAG_FULL_MARK        = 0x10000
+    GPR_FLAG_FULL_MARK        = 0x10000,
+
+    GPR_DEFAULT_REASON =
+        (GPR_FLAG_FULL_MARK | GPR_FLAG_IMMEDIATE_MARK |
+         GPR_FLAG_IMMEDIATE_SWEEP | GPR_FLAG_CAPI),
 } gc_profile_record_flag;
 
 typedef struct gc_profile_record {
@@ -8268,7 +8272,7 @@ gc_compact(rb_objspace_t *objspace, int use_toward_empty, int use_double_pages, https://github.com/ruby/ruby/blob/trunk/gc.c#L8272
     objspace->flags.during_compacting = TRUE;
     {
         /* pin objects referenced by maybe pointers */
-        rb_gc();
+        garbage_collect(objspace, GPR_DEFAULT_REASON);
         /* compact */
         gc_compact_after_gc(objspace, use_toward_empty, use_double_pages, TRUE);
     }
@@ -8396,7 +8400,7 @@ gc_compact_after_gc(rb_objspace_t *objspace, int use_toward_empty, int use_doubl https://github.com/ruby/ruby/blob/trunk/gc.c#L8400
     mjit_gc_exit_hook(); // unlock MJIT here, because `rb_gc()` calls `mjit_gc_start_hook()` again.
 
     /* GC after compaction to eliminate T_MOVED */
-    rb_gc();
+    garbage_collect(objspace, GPR_DEFAULT_REASON);
 }
 
 /*
@@ -8461,8 +8465,7 @@ void https://github.com/ruby/ruby/blob/trunk/gc.c#L8465
 rb_gc(void)
 {
     rb_objspace_t *objspace = &rb_objspace;
-    int reason = GPR_FLAG_FULL_MARK | GPR_FLAG_IMMEDIATE_MARK |
-                GPR_FLAG_IMMEDIATE_SWEEP | GPR_FLAG_CAPI;
+    int reason = GPR_DEFAULT_REASON;
     garbage_collect(objspace, reason);
 }
 
-- 
cgit v0.10.2


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

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