1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
normal 2015-11-01 02:13:54 +00:00
parent 7484d07ca7
commit 513d8b349f
2 changed files with 12 additions and 0 deletions

View file

@ -1,3 +1,7 @@
Sun Nov 1 11:07:31 2015 Eric Wong <e@80x24.org>
* iseq.c (iseq_memsize): account for rb_call_cache entries
Sun Nov 1 09:12:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (parser_yylex): ':' separated by a comment and a newline

8
iseq.c
View file

@ -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;