@@ -10955,16 +10955,17 @@ gc_count(rb_execution_context_t
10000
*ec, VALUE self)
10955
10955
static VALUE
10956
10956
gc_info_decode (rb_objspace_t * objspace , const VALUE hash_or_key , const unsigned int orig_flags )
10957
10957
{
10958
- static VALUE sym_major_by = Qnil , sym_gc_by , sym_immediate_sweep , sym_have_finalizer , sym_state ;
10958
+ static VALUE sym_major_by = Qnil , sym_gc_by , sym_immediate_sweep , sym_have_finalizer , sym_state , sym_need_major_by ;
10959
10959
static VALUE sym_nofree , sym_oldgen , sym_shady , sym_force , sym_stress ;
10960
10960
#if RGENGC_ESTIMATE_OLDMALLOC
10961
10961
static VALUE sym_oldmalloc ;
10962
10962
#endif
10963
10963
static VALUE sym_newobj , sym_malloc , sym_method , sym_capi ;
10964
10964
static VALUE sym_none , sym_marking , sym_sweeping ;
10965
10965
VALUE hash = Qnil , key = Qnil ;
10966
- VALUE major_by ;
10966
+ VALUE major_by , need_major_by ;
10967
10967
unsigned int flags = orig_flags ? orig_flags : objspace -> profile .latest_gc_info ;
10968
+ unsigned int need_major_flags = objspace -> rgengc .need_major_gc ;
10968
10969
10969
10970
if (SYMBOL_P (hash_or_key )) {
10970
10971
key = hash_or_key ;
@@ -10983,6 +10984,7 @@ gc_info_decode(rb_objspace_t *objspace, const VALUE hash_or_key, const unsigned
10983
10984
S (immediate_sweep );
10984
10985
S (have_finalizer );
10985
10986
S (state );
10987
+ S (need_major_by );
10986
10988
10987
10989
S (stress );
10988
10990
S (nofree );
@@ -11020,6 +11022,19 @@ gc_info_decode(rb_objspace_t *objspace, const VALUE hash_or_key, const unsigned
11020
11022
Qnil ;
11021
11023
SET (major_by , major_by );
11022
11024
11025
+ if (orig_flags == 0 ) { /* set need_major_by only if flags not set explicitly */
11026
+ need_major_by =
11027
+ (need_major_flags & GPR_FLAG_MAJOR_BY_NOFREE ) ? sym_nofree :
11028
+ (need_major_flags & GPR_FLAG_MAJOR_BY_OLDGEN ) ? sym_oldgen :
11029
+ (need_major_flags & GPR_FLAG_MAJOR_BY_SHADY ) ? sym_shady :
11030
+ (need_major_flags & GPR_FLAG_MAJOR_BY_FORCE ) ? sym_force :
11031
+ #if RGENGC_ESTIMATE_OLDMALLOC
11032
+ (need_major_flags & GPR_FLAG_MAJOR_BY_OLDMALLOC ) ? sym_oldmalloc :
11033
+ #endif
11034
+ Qnil ;
11035
+ SET (need_major_by , need_major_by );
11036
+ }
11037
+
11023
11038
SET (gc_by ,
11024
11039
(flags & GPR_FLAG_NEWOBJ ) ? sym_newobj :
11025
11040
(flags & GPR_FLAG_MALLOC ) ? sym_malloc :
0 commit comments