@@ -635,22 +635,29 @@ void rb_gc_impl_set_params(void *objspace_ptr) { }
635635
636636static VALUE gc_verify_internal_consistency (VALUE self ) { return Qnil ; }
637637
638- #define MMTK_HEAP_COUNT 6
639- #define MMTK_MAX_OBJ_SIZE 640
640-
638+ #if SIZEOF_VALUE >= 8
639+ #define MMTK_HEAP_COUNT 12
640+ #define MMTK_MAX_OBJ_SIZE 1024
641641static size_t heap_sizes [MMTK_HEAP_COUNT + 1 ] = {
642- 32 , 40 , 80 , 160 , 320 , MMTK_MAX_OBJ_SIZE , 0
642+ 32 , 40 , 64 , 80 , 96 , 128 , 160 , 256 , 512 , 640 , 768 , MMTK_MAX_OBJ_SIZE , 0
643643};
644+ #else
645+ #define MMTK_HEAP_COUNT 5
646+ #define MMTK_MAX_OBJ_SIZE 512
647+ static size_t heap_sizes [MMTK_HEAP_COUNT + 1 ] = {
648+ 32 , 64 , 128 , 256 , MMTK_MAX_OBJ_SIZE , 0
649+ };
650+ #endif
644651
645652void
646653rb_gc_impl_init (void )
647654{
648655 VALUE gc_constants = rb_hash_new ();
656+ rb_hash_aset (gc_constants , ID2SYM (rb_intern ("RVALUE_SIZE" )), SIZET2NUM (SIZEOF_VALUE >= 8 ? 64 : 32 ));
649657 rb_hash_aset (gc_constants , ID2SYM (rb_intern ("RBASIC_SIZE" )), SIZET2NUM (sizeof (struct RBasic )));
650658 rb_hash_aset (gc_constants , ID2SYM (rb_intern ("RVALUE_OVERHEAD" )), INT2NUM (0 ));
651659 rb_hash_aset (gc_constants , ID2SYM (rb_intern ("RVARGC_MAX_ALLOCATE_SIZE" )), LONG2FIX (MMTK_MAX_OBJ_SIZE ));
652- // Pretend we have 5 size pools
653- rb_hash_aset (gc_constants , ID2SYM (rb_intern ("SIZE_POOL_COUNT" )), LONG2FIX (MMTK_HEAP_COUNT ));
660+ rb_hash_aset (gc_constants , ID2SYM (rb_intern ("HEAP_COUNT" )), LONG2FIX (MMTK_HEAP_COUNT ));
654661 // TODO: correctly set RVALUE_OLD_AGE when we have generational GC support
655662 rb_hash_aset (gc_constants , ID2SYM (rb_intern ("RVALUE_OLD_AGE" )), INT2FIX (0 ));
656663 OBJ_FREEZE (gc_constants );
0 commit comments