mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
mjit_compile.c: disable comment_id by default
Doing `rb_ary_aref` to `global_symbols.ids` is not thread-safe and randomly causes SEGV. https://gist.github.com/k0kubun/ab60727c6be7c0e777d2b4241f59173c But it's convenient for development. So I keep it optionally available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ccc2576514
commit
d5e93cb582
1 changed files with 5 additions and 0 deletions
|
@ -78,9 +78,13 @@ compile_case_dispatch_each(VALUE key, VALUE value, VALUE arg)
|
||||||
return ST_CONTINUE;
|
return ST_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MJIT_COMMENT_ID 0
|
||||||
|
|
||||||
|
/* Calling rb_id2str in MJIT worker causes random SEGV. So this is disabled by default. */
|
||||||
static void
|
static void
|
||||||
comment_id(FILE *f, ID id)
|
comment_id(FILE *f, ID id)
|
||||||
{
|
{
|
||||||
|
#ifdef MJIT_COMMENT_ID
|
||||||
VALUE name = rb_id2str(id);
|
VALUE name = rb_id2str(id);
|
||||||
const char *p, *e;
|
const char *p, *e;
|
||||||
char c, prev = '\0';
|
char c, prev = '\0';
|
||||||
|
@ -98,6 +102,7 @@ comment_id(FILE *f, ID id)
|
||||||
prev = c;
|
prev = c;
|
||||||
}
|
}
|
||||||
fputs("\" */", f);
|
fputs("\" */", f);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void compile_insns(FILE *f, const struct rb_iseq_constant_body *body, unsigned int stack_size,
|
static void compile_insns(FILE *f, const struct rb_iseq_constant_body *body, unsigned int stack_size,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue