File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9591,6 +9591,12 @@ rb_gc_impl_init(void)
95919591{
95929592 VALUE gc_constants = rb_hash_new ();
95939593 rb_hash_aset (gc_constants , ID2SYM (rb_intern ("DEBUG" )), GC_DEBUG ? Qtrue : Qfalse );
9594+ /* Minimum slot size that fits a standard RVALUE */
9595+ size_t rvalue_pool = 0 ;
9596+ for (size_t i = 0 ; i < HEAP_COUNT ; i ++ ) {
9597+ if (pool_slot_sizes [i ] >= RVALUE_SLOT_SIZE ) { rvalue_pool = pool_slot_sizes [i ]; break ; }
9598+ }
9599+ rb_hash_aset (gc_constants , ID2SYM (rb_intern ("RVALUE_SIZE" )), SIZET2NUM (rvalue_pool - RVALUE_OVERHEAD ));
95949600 rb_hash_aset (gc_constants , ID2SYM (rb_intern ("RBASIC_SIZE" )), SIZET2NUM (sizeof (struct RBasic )));
95959601 rb_hash_aset (gc_constants , ID2SYM (rb_intern ("RVALUE_OVERHEAD" )), SIZET2NUM (RVALUE_OVERHEAD ));
95969602 rb_hash_aset (gc_constants , ID2SYM (rb_intern ("HEAP_PAGE_BITMAP_SIZE" )), SIZET2NUM (HEAP_PAGE_BITMAP_SIZE ));
Original file line number Diff line number Diff line change 653653rb_gc_impl_init (void )
654654{
655655 VALUE gc_constants = rb_hash_new ();
656+ rb_hash_aset (gc_constants , ID2SYM (rb_intern ("RVALUE_SIZE" )), SIZET2NUM (SIZEOF_VALUE >= 8 ? 64 : 32 ));
656657 rb_hash_aset (gc_constants , ID2SYM (rb_intern ("RBASIC_SIZE" )), SIZET2NUM (sizeof (struct RBasic )));
657658 rb_hash_aset (gc_constants , ID2SYM (rb_intern ("RVALUE_OVERHEAD" )), INT2NUM (0 ));
658659 rb_hash_aset (gc_constants , ID2SYM (rb_intern ("RVARGC_MAX_ALLOCATE_SIZE" )), LONG2FIX (MMTK_MAX_OBJ_SIZE ));
You can’t perform that action at this time.
0 commit comments