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;
|
break;
|
||||||
case T_HASH:
|
case T_HASH:
|
||||||
if (RHASH_AR_TABLE_P(obj)) {
|
if (RHASH_AR_TABLE_P(obj)) {
|
||||||
size_t rb_hash_ar_table_size();
|
if (RHASH_AR_TABLE(obj) != NULL) {
|
||||||
size += rb_hash_ar_table_size();
|
size_t rb_hash_ar_table_size();
|
||||||
|
size += rb_hash_ar_table_size();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VM_ASSERT(RHASH_ST_TABLE(obj) != NULL);
|
VM_ASSERT(RHASH_ST_TABLE(obj) != NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue