summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/object.c b/object.c
index 075deef974..1156b69767 100644
--- a/object.c
+++ b/object.c
@@ -134,9 +134,8 @@ rb_class_allocate_instance(VALUE klass)
RUBY_ASSERT(rb_shape_get_shape(obj)->type == SHAPE_ROOT);
- // Set the shape to the specific T_OBJECT shape which is always
- // SIZE_POOL_COUNT away from the root shape.
- ROBJECT_SET_SHAPE_ID(obj, ROBJECT_SHAPE_ID(obj) + SIZE_POOL_COUNT);
+ // Set the shape to the specific T_OBJECT shape.
+ ROBJECT_SET_SHAPE_ID(obj, SIZE_POOL_COUNT + rb_gc_size_pool_id_for_size(size));
#if RUBY_DEBUG
RUBY_ASSERT(!rb_shape_obj_too_complex(obj));