aboutsummaryrefslogtreecommitdiffstats
path: root/mjit.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-24 14:36:10 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-24 14:36:10 +0000
commit7e70d6bcf7a51a77b9830c50bbc06c54ec568544 (patch)
tree6d3e3a89ed243a645effeb8a3cd4d817e11cae45 /mjit.c
parentcc629b25f340a2e46c975827c29a3f664609089a (diff)
downloadruby-7e70d6bcf7a51a77b9830c50bbc06c54ec568544.tar.gz
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
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mjit.c b/mjit.c
index 7a1b3a1383..473f60ccb4 100644
--- a/mjit.c
+++ b/mjit.c
@@ -334,7 +334,7 @@ form_args(int num, ...)
for (i = len = 0; i < num; i++) {
args = va_arg(argp, char **);
n = args_len(args);
- REALLOC_N(res, char *, len + n + 1);
+ res = (char **)realloc(res, sizeof(char *) * (len + n + 1));
MEMCPY(res + len, args, char *, n + 1);
len += n;
}
@@ -717,7 +717,7 @@ make_pch(void)
}
exit_code = exec_process(cc_path, args);
- xfree(args);
+ free(args);
#endif
CRITICAL_SECTION_START(3, "in make_pch");
@@ -766,7 +766,7 @@ compile_c_to_so(const char *c_file, const char *so_file)
#ifdef _MSC_VER
solen = strlen(so_file);
- files[0] = p = xmalloc(rb_strlen_lit("-Fe") + solen + 1);
+ files[0] = p = (char *)malloc(sizeof(char) * (rb_strlen_lit("-Fe") + solen + 1));
p = append_lit(p, "-Fe");
p = append_str2(p, so_file, solen);
*p = '\0';
@@ -784,9 +784,9 @@ compile_c_to_so(const char *c_file, const char *so_file)
return FALSE;
exit_code = exec_process(cc_path, args);
- xfree(args);
+ free(args);
#ifdef _MSC_VER
- xfree((char *)files[0]);
+ free((char *)files[0]);
#endif
if (exit_code != 0)