diff options
author | John Hawthorn <john@hawthorn.email> | 2022-01-29 21:27:53 -0800 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2022-02-23 19:57:42 -0800 |
commit | 764e4fa850de749790e5ed11c8a4ab86a4499ac0 (patch) | |
tree | 29386c80ba035a2fee18c68dd9cb27f5b3ebe9d2 /ext/objspace | |
parent | 709a6a078642e30c310e7355202a29e529361776 (diff) |
Never call kind_of with klass=0
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5568
Diffstat (limited to 'ext/objspace')
-rw-r--r-- | ext/objspace/objspace.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c index d33dfeb80a..bd80e540cf 100644 --- a/ext/objspace/objspace.c +++ b/ext/objspace/objspace.c @@ -61,14 +61,7 @@ total_i(VALUE v, void *ptr) { struct total_data *data = (struct total_data *)ptr; - switch (BUILTIN_TYPE(v)) { - case T_NONE: - case T_IMEMO: - case T_ICLASS: - case T_NODE: - case T_ZOMBIE: - return; - default: + if (!rb_objspace_internal_object_p(v)) { if (data->klass == 0 || rb_obj_is_kind_of(v, data->klass)) { data->total += rb_obj_memsize_of(v); } |