From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS8100 96.47.226.0/23 X-Spam-Status: No, score=-2.0 required=3.0 tests=AWL,BAYES_00,RCVD_IN_XBL shortcircuit=no autolearn=no version=3.3.2 X-Original-To: spew@80x24.org Received: from 80x24.org (bolobolo1.torservers.net [96.47.226.20]) by dcvr.yhbt.net (Postfix) with ESMTP id B759D633843 for ; Sat, 31 Oct 2015 01:31:05 +0000 (UTC) From: Eric Wong To: spew@80x24.org Subject: [PATCH] iseq.c (iseq_memsize): account for rb_call_cache entries Date: Sat, 31 Oct 2015 01:31:03 +0000 Message-Id: <20151031013103.924-1-e@80x24.org> List-Id: untested. check this more closely --- iseq.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iseq.c b/iseq.c index 6b243fe..75886c2 100644 --- a/iseq.c +++ b/iseq.c @@ -164,6 +164,7 @@ iseq_memsize(const rb_iseq_t *iseq) if (body) { struct rb_call_info_with_kwarg *ci_kw_entries = (struct rb_call_info_with_kwarg *)&body->ci_entries[body->ci_size]; + size_t cc_ent; size += sizeof(struct rb_iseq_constant_body); size += body->iseq_size * sizeof(VALUE); @@ -178,6 +179,9 @@ iseq_memsize(const rb_iseq_t *iseq) size += body->ci_size * sizeof(struct rb_call_info); size += body->ci_kw_size * sizeof(struct rb_call_info_with_kwarg); + cc_ent = body->ci_size * body->ci_kw_size; + size += cc_ent * sizeof(struct rb_call_cache); + if (ci_kw_entries) { unsigned int i; -- EW