ruby-changes:63464
From: Aaron <ko1@a...>
Date: Thu, 29 Oct 2020 01:45:46 +0900 (JST)
Subject: [ruby-changes:63464] 2c19c1484a (master): If an object isn't embedded it will have an ivptr
https://git.ruby-lang.org/ruby.git/commit/?id=2c19c1484a From 2c19c1484abda749540c5865de4dce5a47fc8f0f Mon Sep 17 00:00:00 2001 From: Aaron Patterson <tenderlove@r...> Date: Wed, 28 Oct 2020 09:42:34 -0700 Subject: 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 diff --git a/gc.c b/gc.c index c97246a..d316feb 100644 --- a/gc.c +++ b/gc.c @@ -4077,9 +4077,8 @@ obj_memsize_of(VALUE obj, int use_all_types) https://github.com/ruby/ruby/blob/trunk/gc.c#L4077 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: -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/