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

vm_ccs_push: do not cache non-heap entries

Entires not GC-able must be considered to be volatile.  Not eligible for
later use.
This commit is contained in:
卜部昌平 2020-06-05 15:55:05 +09:00
parent e1e84fbb4f
commit ffe58b9c8b
Notes: git 2020-06-09 09:53:15 +09:00

View file

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