diff --git a/shape.c b/shape.c index 89a2c3bd0bef8a..7cdc4c1cc77b14 100644 --- a/shape.c +++ b/shape.c @@ -865,6 +865,7 @@ Init_default_shapes(void) hash_fallback_shape->size_pool_index = 0; RUBY_ASSERT(OBJ_TOO_COMPLEX_SHAPE_ID == (GET_SHAPE_TREE()->next_shape_id - 1)); RUBY_ASSERT(rb_shape_id(hash_fallback_shape) == OBJ_TOO_COMPLEX_SHAPE_ID); + fprintf(stderr, "sizeof(rb_shape_t) => %lu\n", sizeof(rb_shape_t)); } void diff --git a/shape.h b/shape.h index 5689b480670c12..1b2221ad769987 100644 --- a/shape.h +++ b/shape.h @@ -6,12 +6,11 @@ #if (SIZEOF_UINT64_T <= SIZEOF_VALUE) #define SIZEOF_SHAPE_T 4 #define SHAPE_IN_BASIC_FLAGS 1 -typedef uint32_t attr_index_t; #else #define SIZEOF_SHAPE_T 2 #define SHAPE_IN_BASIC_FLAGS 0 -typedef uint16_t attr_index_t; #endif +typedef uint8_t attr_index_t; #define MAX_IVARS (attr_index_t)(-1) @@ -44,7 +43,7 @@ struct rb_shape { struct rb_id_table * edges; // id_table from ID (ivar) to next shape ID edge_name; // ID (ivar) for transition from parent to rb_shape attr_index_t next_iv_index; - uint32_t capacity; // Total capacity of the object with this shape + attr_index_t capacity; // Total capacity of the object with this shape uint8_t type; uint8_t size_pool_index; shape_id_t parent_id;