From 83c9263b85d8ebd8db446f9a339a0231a0f0d3d5 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Tue, 24 Jul 2018 14:36:10 +0000 Subject: mjit.c: prevent GC on MJIT worker mjit_compile.c: ditto. REALLOC_N, ALLOC_N and xmalloc trigger GC but it's not expected. Other allocation calls in mjit.c are executed on Ruby's main thread and thus fine. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- mjit_compile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mjit_compile.c') diff --git a/mjit_compile.c b/mjit_compile.c index 5eafd72329..7b8e2a7312 100644 --- a/mjit_compile.c +++ b/mjit_compile.c @@ -192,7 +192,7 @@ mjit_compile(FILE *f, const struct rb_iseq_constant_body *body, const char *func struct compile_status status; status.success = TRUE; status.local_stack_p = !body->catch_except_p; - status.stack_size_for_pos = ALLOC_N(int, body->iseq_size); + status.stack_size_for_pos = (int *)malloc(sizeof(int) * body->iseq_size); memset(status.stack_size_for_pos, NOT_COMPILED_STACK_SIZE, sizeof(int) * body->iseq_size); /* For performance, we verify stack size only on compilation time (mjit_compile.inc.erb) without --jit-debug */ @@ -232,6 +232,6 @@ mjit_compile(FILE *f, const struct rb_iseq_constant_body *body, const char *func compile_cancel_handler(f, body, &status); fprintf(f, "\n} /* end of %s */\n", funcname); - xfree(status.stack_size_for_pos); + free(status.stack_size_for_pos); return status.success; } -- cgit v1.2.3