From 2c19c1484abda749540c5865de4dce5a47fc8f0f Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 28 Oct 2020 09:42:34 -0700 Subject: [PATCH] If an object isn't embedded it will have an ivptr We don't need to check the existence if an ivptr because non-embedded objects will always have one --- gc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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: