Unverified Commit 7fb62670 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #5127 from...

Merge pull request #5127 from shuujii/include-size-of-iv-table-in-ObjectSpace.memsize_of-to-Hash-object

Include size of iv table in `ObjectSpace.memsize_of` to `Hash` object
parents 75beb55c 292a0961
......@@ -1034,10 +1034,11 @@ size_t
mrb_hash_memsize(mrb_value self)
{
struct RHash *h = mrb_hash_ptr(self);
return h_ar_p(h) ? (ar_ea_capa(h) * sizeof(hash_entry)) :
(ht_ea_capa(h) * sizeof(hash_entry) +
sizeof(hash_table) +
ib_byte_size_for(ib_bit(h)));
return mrb_obj_iv_tbl_memsize(self) +
(h_ar_p(h) ? (ar_ea_capa(h) * sizeof(hash_entry)) :
(ht_ea_capa(h) * sizeof(hash_entry) +
sizeof(hash_table) +
ib_byte_size_for(ib_bit(h))));
}
/* Iterates over the key/value pairs. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment