diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-06-05 15:55:05 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-06-09 09:52:46 +0900 |
commit | ffe58b9c8bde9fa95e91a458e334b375a37ef974 (patch) | |
tree | ce15b4cf97b66d00b6c6808701a013a2e0867072 /vm_insnhelper.c | |
parent | e1e84fbb4f7df57d48fd2b1331edd0d521df7812 (diff) | |
download | ruby-ffe58b9c8bde9fa95e91a458e334b375a37ef974.tar.gz |
vm_ccs_push: do not cache non-heap entries
Entires not GC-able must be considered to be volatile. Not eligible for
later use.
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 15ccf23386..11e03f853d 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1473,6 +1473,13 @@ vm_ccs_create(VALUE klass, const rb_callable_method_entry_t *cme) static void vm_ccs_push(VALUE klass, struct rb_class_cc_entries *ccs, const struct rb_callinfo *ci, const struct rb_callcache *cc) { + if (! vm_cc_markable(cc)) { + return; + } + else if (! vm_ci_markable(ci)) { + return; + } + if (UNLIKELY(ccs->len == ccs->capa)) { const int nsize = ccs->capa * 2; struct rb_class_cc_entries_entry *nents = ALLOC_N(struct rb_class_cc_entries_entry, nsize); |