mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fix empty Hash memsize.
* gc.c (obj_memsize_of): ar_table ptr can be NULL (size == 0). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9653f770ae
commit
91cb5c1a70
1 changed files with 4 additions and 2 deletions
6
gc.c
6
gc.c
|
@ -3356,8 +3356,10 @@ obj_memsize_of(VALUE obj, int use_all_types)
|
|||
break;
|
||||
case T_HASH:
|
||||
if (RHASH_AR_TABLE_P(obj)) {
|
||||
size_t rb_hash_ar_table_size();
|
||||
size += rb_hash_ar_table_size();
|
||||
if (RHASH_AR_TABLE(obj) != NULL) {
|
||||
size_t rb_hash_ar_table_size();
|
||||
size += rb_hash_ar_table_size();
|
||||
}
|
||||
}
|
||||
else {
|
||||
VM_ASSERT(RHASH_ST_TABLE(obj) != NULL);
|
||||
|
|
Loading…
Reference in a new issue