diff --git a/gc.c b/gc.c index c97246a9cc..d316febfc1 100644 --- a/gc.c +++ b/gc.c @@ -4077,9 +4077,8 @@ obj_memsize_of(VALUE obj, int use_all_types) switch (BUILTIN_TYPE(obj)) { case T_OBJECT: - if (!(RBASIC(obj)->flags & ROBJECT_EMBED) && - ROBJECT(obj)->as.heap.ivptr) { - size += ROBJECT(obj)->as.heap.numiv * sizeof(VALUE); + if (!(RBASIC(obj)->flags & ROBJECT_EMBED)) { + size += ROBJECT_NUMIV(obj) * sizeof(VALUE); } break; case T_MODULE: