aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-01 02:13:54 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-01 02:13:54 +0000
commit513d8b349f3e37c3fa43a11148a68a2e14836fcb (patch)
tree6277c6bcf9aaac149690028cb6c3763a7b540818 /iseq.c
parent7484d07ca765770619b32a744fde15ae240a3517 (diff)
downloadruby-513d8b349f3e37c3fa43a11148a68a2e14836fcb.tar.gz
iseq.c (iseq_memsize): account for rb_call_cache entries
Add some comments to clarify the allocated field used for the allocations while we're at it. TODO: figure out a better way of testing/maintaining this... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/iseq.c b/iseq.c
index 6b243feb7e..b1f05a2d62 100644
--- a/iseq.c
+++ b/iseq.c
@@ -174,10 +174,18 @@ iseq_memsize(const rb_iseq_t *iseq)
}
size += (body->param.opt_num + 1) * sizeof(VALUE);
size += param_keyword_size(body->param.keyword);
+
+ /* body->is_entries */
size += body->is_size * sizeof(union iseq_inline_storage_entry);
+
+ /* body->ci_entries */
size += body->ci_size * sizeof(struct rb_call_info);
size += body->ci_kw_size * sizeof(struct rb_call_info_with_kwarg);
+ /* body->cc_entries */
+ size += body->ci_size * sizeof(struct rb_call_cache);
+ size += body->ci_kw_size * sizeof(struct rb_call_cache);
+
if (ci_kw_entries) {
unsigned int i;