dumping ground for random patches and texts
 help / color / mirror / Atom feed
* [PATCH] iseq.c (iseq_memsize): account for rb_call_cache entries
@ 2015-10-31  1:31 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-10-31  1:31 UTC (permalink / raw)
  To: spew

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-31  1:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-31  1:31 [PATCH] iseq.c (iseq_memsize): account for rb_call_cache entries Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).