mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Remove VM lock in register_static_symid
This commit is contained in:
parent
42f95456cc
commit
bd2d6845f1
1 changed files with 1 additions and 11 deletions
12
symbol.c
12
symbol.c
|
@ -51,7 +51,6 @@
|
||||||
#define STATIC_SYM2ID(sym) RSHIFT((VALUE)(sym), RUBY_SPECIAL_SHIFT)
|
#define STATIC_SYM2ID(sym) RSHIFT((VALUE)(sym), RUBY_SPECIAL_SHIFT)
|
||||||
|
|
||||||
static ID register_static_symid(ID, const char *, long, rb_encoding *);
|
static ID register_static_symid(ID, const char *, long, rb_encoding *);
|
||||||
static ID register_static_symid_str(ID, VALUE);
|
|
||||||
#define REGISTER_SYMID(id, name) register_static_symid((id), (name), strlen(name), enc)
|
#define REGISTER_SYMID(id, name) register_static_symid((id), (name), strlen(name), enc)
|
||||||
#include "id.c"
|
#include "id.c"
|
||||||
|
|
||||||
|
@ -803,21 +802,12 @@ static ID
|
||||||
register_static_symid(ID id, const char *name, long len, rb_encoding *enc)
|
register_static_symid(ID id, const char *name, long len, rb_encoding *enc)
|
||||||
{
|
{
|
||||||
VALUE str = rb_enc_str_new(name, len, enc);
|
VALUE str = rb_enc_str_new(name, len, enc);
|
||||||
return register_static_symid_str(id, str);
|
|
||||||
}
|
|
||||||
|
|
||||||
static ID
|
|
||||||
register_static_symid_str(ID id, VALUE str)
|
|
||||||
{
|
|
||||||
OBJ_FREEZE(str);
|
OBJ_FREEZE(str);
|
||||||
str = rb_fstring(str);
|
str = rb_fstring(str);
|
||||||
|
|
||||||
RUBY_DTRACE_CREATE_HOOK(SYMBOL, RSTRING_PTR(str));
|
RUBY_DTRACE_CREATE_HOOK(SYMBOL, RSTRING_PTR(str));
|
||||||
|
|
||||||
GLOBAL_SYMBOLS_LOCKING(symbols) {
|
sym_find_or_insert_static_symbol_id(&ruby_global_symbols, str, id);
|
||||||
// TODO: remove this function
|
|
||||||
sym_find_or_insert_static_symbol_id(symbols, str, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue