diff options
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -6038,12 +6038,12 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si } if (type == MEMOP_TYPE_MALLOC) { - if (ruby_gc_stress && !ruby_disable_gc_stress) { + if (ruby_gc_stress && !ruby_disable_gc_stress && ruby_native_thread_p()) { garbage_collect_with_gvl(objspace, FALSE, TRUE, GPR_FLAG_MALLOC); } else { retry: - if (malloc_increase > malloc_limit) { + if (malloc_increase > malloc_limit && ruby_native_thread_p()) { if (ruby_thread_has_gvl_p() && is_lazy_sweeping(heap_eden)) { gc_rest_sweep(objspace); /* rest_sweep can reduce malloc_increase */ goto retry; |