diff options
author | Nobuyoshi Nakada <[email protected]> | 2019-08-13 09:43:11 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2019-08-13 09:47:08 +0900 |
commit | ac656bc2bda6c7879b4b2170b7c2386a08112689 (patch) | |
tree | ee8344509d1a83d8e6264f694339c3345f78b954 /gc.c | |
parent | 917d766508707ebf894244fe4624b064315a7ad7 (diff) |
Hoisted out GPR_DEFAULT_REASON
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -348,7 +348,11 @@ typedef enum { 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, 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 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 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); } |