From 1613917ae6441b98a52d885f0df1479652be755d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 24 Apr 2019 17:34:21 +0900 Subject: [PATCH] Defer setting gc_stress instead of setting dont_gc [Bug #15784] --- gc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gc.c b/gc.c index a12854d636..82199bb47e 100644 --- a/gc.c +++ b/gc.c @@ -2571,10 +2571,6 @@ Init_heap(void) objspace->id_to_obj_tbl = st_init_numtable(); objspace->obj_to_id_tbl = st_init_numtable(); - dont_gc = 1; - - gc_stress_set(objspace, ruby_initial_gc_stress); - #if RGENGC_ESTIMATE_OLDMALLOC objspace->rgengc.oldmalloc_increase_limit = gc_params.oldmalloc_limit_min; #endif @@ -2591,7 +2587,7 @@ Init_gc_stress(void) { rb_objspace_t *objspace = &rb_objspace; - dont_gc = 0; + gc_stress_set(objspace, ruby_initial_gc_stress); } typedef int each_obj_callback(void *, void *, size_t, void *);